diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index a561ad4654..5db3e2ebc2 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -255,7 +255,7 @@ jobs: build: name: Build needs: changes - runs-on: ${{ matrix.platform }} + runs-on: ubuntu-latest if: ${{ needs.changes.outputs.package_count_deps > 0 && github.event_name != 'pull_request' }} strategy: fail-fast: false diff --git a/.github/workflows/goreleaser-actions.yml b/.github/workflows/goreleaser-actions.yml index b7cd199231..696265369c 100644 --- a/.github/workflows/goreleaser-actions.yml +++ b/.github/workflows/goreleaser-actions.yml @@ -108,7 +108,6 @@ jobs: env: FILTERED_PATHS: ${{ steps.filter_go.outputs.changed_modules_deps }} - # TODO: we may want to dry run this on prs run-goreleaser: runs-on: - namespace-profile-fast-goreleaser diff --git a/.golangci.yml b/.golangci.yml index a789c11a26..c8e20508a3 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -145,4 +145,4 @@ issues: - staticcheck - wrapcheck exclude-use-default: false - new-from-rev: a9a6f84f0569de877d06a027257aeca266aeda49 + new-from-rev: 9fe0f033b73acf6b8240f0a832c4b4d21e68181b diff --git a/agents/go.mod b/agents/go.mod index e2cc3a7f30..e885ddb803 100644 --- a/agents/go.mod +++ b/agents/go.mod @@ -35,7 +35,7 @@ require ( go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 go.opentelemetry.io/otel v1.28.0 go.opentelemetry.io/otel/trace v1.28.0 - golang.org/x/sync v0.7.0 + golang.org/x/sync v0.8.0 google.golang.org/grpc v1.64.0 gopkg.in/yaml.v2 v2.4.0 gorm.io/driver/mysql v1.5.6 @@ -239,7 +239,7 @@ require ( github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.15 // indirect + github.com/mattn/go-runewidth v0.0.16 // indirect github.com/mattn/go-sqlite3 v2.0.3+incompatible // indirect github.com/mattn/go-tty v0.0.3 // indirect github.com/miguelmota/go-ethereum-hdwallet v0.1.1 // indirect @@ -318,17 +318,17 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/arch v0.8.0 // indirect - golang.org/x/crypto v0.24.0 // indirect - golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect + golang.org/x/crypto v0.26.0 // indirect + golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 // indirect golang.org/x/image v0.6.0 // indirect - golang.org/x/mod v0.19.0 // indirect - golang.org/x/net v0.26.0 // indirect + golang.org/x/mod v0.20.0 // indirect + golang.org/x/net v0.28.0 // indirect golang.org/x/oauth2 v0.21.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/term v0.21.0 // indirect - golang.org/x/text v0.16.0 // indirect + golang.org/x/sys v0.24.0 // indirect + golang.org/x/term v0.23.0 // indirect + golang.org/x/text v0.17.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.22.0 // indirect + golang.org/x/tools v0.24.0 // indirect google.golang.org/api v0.183.0 // indirect google.golang.org/genproto v0.0.0-20240528184218-531527333157 // indirect google.golang.org/protobuf v1.34.2 // indirect diff --git a/agents/go.sum b/agents/go.sum index e37aacbca6..3219fb0629 100644 --- a/agents/go.sum +++ b/agents/go.sum @@ -872,8 +872,8 @@ github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzp github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= -github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= -github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= +github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U= github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= @@ -1329,8 +1329,8 @@ golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2Uz golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1344,8 +1344,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 h1:yixxcjnhBmY0nkL253HFVIm0JsFHwrHdT3Yh6szTnfY= -golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8/go.mod h1:jj3sYF3dwk5D+ghuXyeI3r5MFf+NT2An6/9dOA95KSI= +golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 h1:kx6Ds3MlpiUHKj7syVnbp57++8WpuKPcR5yjLBjvLEA= +golang.org/x/exp v0.0.0-20240823005443-9b4947da3948/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -1379,8 +1379,8 @@ golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= -golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= +golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1440,8 +1440,8 @@ golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1466,8 +1466,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1564,8 +1564,8 @@ golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1575,8 +1575,8 @@ golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= +golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1592,8 +1592,8 @@ golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1665,8 +1665,8 @@ golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= -golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/contrib/git-changes-action/go.mod b/contrib/git-changes-action/go.mod index cda3c4add6..83faeb6f8a 100644 --- a/contrib/git-changes-action/go.mod +++ b/contrib/git-changes-action/go.mod @@ -24,8 +24,8 @@ require ( github.com/synapsecns/sanguine/core v0.0.0-00010101000000-000000000000 github.com/vishalkuo/bimap v0.0.0-20230830142743-a9fb9b52066c github.com/xlab/treeprint v1.2.0 - golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 - golang.org/x/mod v0.19.0 + golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 + golang.org/x/mod v0.20.0 golang.org/x/oauth2 v0.21.0 ) @@ -66,12 +66,12 @@ require ( github.com/xanzy/ssh-agent v0.3.3 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/crypto v0.24.0 // indirect - golang.org/x/net v0.26.0 // indirect - golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/text v0.16.0 // indirect - golang.org/x/tools v0.22.0 // indirect + golang.org/x/crypto v0.26.0 // indirect + golang.org/x/net v0.28.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.24.0 // indirect + golang.org/x/text v0.17.0 // indirect + golang.org/x/tools v0.24.0 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/apimachinery v0.29.3 // indirect diff --git a/contrib/git-changes-action/go.sum b/contrib/git-changes-action/go.sum index 0bf0b64325..9781a72712 100644 --- a/contrib/git-changes-action/go.sum +++ b/contrib/git-changes-action/go.sum @@ -303,8 +303,8 @@ golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -315,8 +315,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 h1:yixxcjnhBmY0nkL253HFVIm0JsFHwrHdT3Yh6szTnfY= -golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8/go.mod h1:jj3sYF3dwk5D+ghuXyeI3r5MFf+NT2An6/9dOA95KSI= +golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 h1:kx6Ds3MlpiUHKj7syVnbp57++8WpuKPcR5yjLBjvLEA= +golang.org/x/exp v0.0.0-20240823005443-9b4947da3948/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -343,8 +343,8 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= -golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= +golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -382,8 +382,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -408,8 +408,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -457,15 +457,15 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= +golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -477,8 +477,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -536,8 +536,8 @@ golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= -golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/contrib/opbot/README.md b/contrib/opbot/README.md index 690f7ea302..e09a8c3227 100644 --- a/contrib/opbot/README.md +++ b/contrib/opbot/README.md @@ -3,6 +3,9 @@ [![Go Reference](https://pkg.go.dev/badge/github.com/synapsecns/sanguine/contrib/opbot.svg)](https://pkg.go.dev/github.com/synapsecns/sanguine/contrib/opbot) [![Go Report Card](https://goreportcard.com/badge/github.com/synapsecns/sanguine/contrib/opbot)](https://goreportcard.com/report/github.com/synapsecns/sanguine/contrib/opbot) +![icon.png](icon.png) + + OpBot is a Slack bot written in Go that interacts with the Signoz trace API to provide various functionalities, including searching for transactions based on user-provided tags. This bot is designed to help teams monitor and manage their operations more effectively by integrating with Slack and Signoz. ## Features @@ -45,13 +48,15 @@ signoz_password: "your-signoz-password" signoz_base_url: "https://signoz.example.com" ``` +Tokens can be obtained [here](https://api.slack.com/tutorials/tracks/getting-a-token). When creating an app, you can copy and paste the [manifest](manifest.json) file to configure the app automatically. + ### Configuration Fields -- `slack_bot_token`: The token for your Slack bot. -- `slack_app_token`: The token for your Slack app. -- `signoz_email`: The email address used to log in to Signoz. +- `slack_bot_token`: The [bot token](https://api.slack.com/concepts/token-types#bot) for your Slack bot. +- `slack_app_token`: The [app token](https://api.slack.com/concepts/token-types#app-level) for your Slack app. +- `signoz_email`: The email address used to log in to [Signoz](https://signoz.io/docs/userguide/authentication/). - `signoz_password`: The password used to log in to Signoz. -- `signoz_base_url`: The base URL for the Signoz API. +- `signoz_base_url`: The base URL for the Signoz API instance (example: http://mysignoz ) ## Usage @@ -75,3 +80,46 @@ signoz_base_url: "https://signoz.example.com" - **`signoz`**: Contains the Signoz client for interacting with the Signoz API. Feel free to reach out if you have any questions or need further assistance! + +Certainly! I'll provide a step-by-step guide on how to add a new command to OpBot based on the information available in the provided code files. + +### Adding a Command + +1. **Create a new command function** + In the `botmd/botmd.go` file, add a new method to the `Bot` struct. This method should return a `*slacker.CommandDefinition`. For example: + + ```go + func (b *Bot) newCommand() *slacker.CommandDefinition { + return &slacker.CommandDefinition{ + Command: "your-command ", + Description: "Description of your command", + Handler: func(botCtx slacker.BotContext, request slacker.Request, response slacker.ResponseWriter) { + // Command logic goes here + }, + } + } + ``` + +2. **Add the command to the bot** + In the `NewBot` function within `botmd/botmd.go`, add your new command to the `addCommands` call: + + ```go + bot.addCommands( + bot.traceCommand(), + bot.rfqLookupCommand(), + bot.rfqRefund(), + bot.newCommand(), // Add your new command here + ) + ``` + +3. **Implement command logic** + In the `Handler` function of your command, implement the logic for your command. You can access bot resources like `b.signozClient`, `b.rpcClient`, etc., to interact with different services. + +4. **Add any necessary configuration** + If your command requires additional configuration, add the necessary fields to the `config.Config` struct in the `config/config.go` file. + +5. **Update the README** + Add information about your new command to the README.md file, including its usage and any new configuration options. + +6. **Test your command** + Rebuild the bot and test your new command in Slack to ensure it works as expected. diff --git a/contrib/opbot/botmd/botmd.go b/contrib/opbot/botmd/botmd.go index cba277b6f9..e23444f05e 100644 --- a/contrib/opbot/botmd/botmd.go +++ b/contrib/opbot/botmd/botmd.go @@ -3,11 +3,14 @@ package botmd import ( "context" "fmt" + "github.com/slack-io/slacker" "github.com/synapsecns/sanguine/contrib/opbot/config" "github.com/synapsecns/sanguine/contrib/opbot/signoz" + screenerClient "github.com/synapsecns/sanguine/contrib/screener-api/client" "github.com/synapsecns/sanguine/core/dbcommon" "github.com/synapsecns/sanguine/core/metrics" + "github.com/synapsecns/sanguine/core/metrics/instrumentation/slackertrace" signerConfig "github.com/synapsecns/sanguine/ethergo/signer/config" "github.com/synapsecns/sanguine/ethergo/signer/signer" "github.com/synapsecns/sanguine/ethergo/submitter" @@ -26,6 +29,7 @@ type Bot struct { rpcClient omnirpcClient.RPCClient signer signer.Signer submitter submitter.TransactionSubmitter + screener screenerClient.ScreenerClient } // NewBot creates a new bot server. @@ -45,7 +49,7 @@ func NewBot(handler metrics.Handler, cfg config.Config) *Bot { bot.rpcClient = omnirpcClient.NewOmnirpcClient(cfg.OmniRPCURL, handler, omnirpcClient.WithCaptureReqRes()) - bot.addMiddleware(bot.tracingMiddleware(), bot.metricsMiddleware()) + bot.addMiddleware(slackertrace.TracingMiddleware(handler), slackertrace.MetricsMiddleware()) bot.addCommands(bot.traceCommand(), bot.rfqLookupCommand(), bot.rfqRefund()) return &bot @@ -65,8 +69,11 @@ func (b *Bot) addCommands(commands ...*slacker.CommandDefinition) { // Start starts the bot server. // nolint: wrapcheck -func (b *Bot) Start(ctx context.Context) error { - var err error +func (b *Bot) Start(ctx context.Context) (err error) { + if err := b.cfg.Validate(); err != nil { + return fmt.Errorf("config validation failed: %w", err) + } + b.signer, err = signerConfig.SignerFromConfig(ctx, b.cfg.Signer) if err != nil { return fmt.Errorf("failed to create signer: %w", err) @@ -84,6 +91,12 @@ func (b *Bot) Start(ctx context.Context) error { b.submitter = submitter.NewTransactionSubmitter(b.handler, b.signer, b.rpcClient, store.SubmitterDB(), &b.cfg.SubmitterConfig) + screenerClient, err := screenerClient.NewClient(b.handler, b.cfg.ScreenerURL) + if err != nil { + return fmt.Errorf("could not create screener client: %w", err) + } + b.screener = screenerClient + g, ctx := errgroup.WithContext(ctx) g.Go(func() error { return b.submitter.Start(ctx) diff --git a/contrib/opbot/botmd/commands.go b/contrib/opbot/botmd/commands.go index 62d5d5e164..4ee3355982 100644 --- a/contrib/opbot/botmd/commands.go +++ b/contrib/opbot/botmd/commands.go @@ -152,7 +152,7 @@ func (b *Bot) rfqLookupCommand() *slacker.CommandDefinition { Handler: func(ctx *slacker.CommandContext) { type Status struct { relayer string - *relapi.GetQuoteRequestStatusResponse + *relapi.GetQuoteRequestResponse } var statuses []Status @@ -175,26 +175,26 @@ func (b *Bot) rfqLookupCommand() *slacker.CommandDefinition { client := relapi.NewRelayerClient(b.handler, relayer) go func() { defer wg.Done() - res, err := client.GetQuoteRequestStatusByTxHash(ctx.Context(), tx) + res, err := client.GetQuoteRequestByTxHash(ctx.Context(), tx) if err != nil { log.Printf("error fetching quote request status by tx hash: %v\n", err) return } sliceMux.Lock() defer sliceMux.Unlock() - statuses = append(statuses, Status{relayer: relayer, GetQuoteRequestStatusResponse: res}) + statuses = append(statuses, Status{relayer: relayer, GetQuoteRequestResponse: res}) }() go func() { defer wg.Done() - res, err := client.GetQuoteRequestStatusByTxID(ctx.Context(), tx) + res, err := client.GetQuoteRequestByTXID(ctx.Context(), tx) if err != nil { log.Printf("error fetching quote request status by tx id: %v\n", err) return } sliceMux.Lock() defer sliceMux.Unlock() - statuses = append(statuses, Status{relayer: relayer, GetQuoteRequestStatusResponse: res}) + statuses = append(statuses, Status{relayer: relayer, GetQuoteRequestResponse: res}) }() } wg.Wait() @@ -234,7 +234,7 @@ func (b *Bot) rfqLookupCommand() *slacker.CommandDefinition { }, { Type: slack.MarkdownType, - Text: fmt.Sprintf("*Estimated Tx Age*: %s", getTxAge(ctx.Context(), client, status.GetQuoteRequestStatusResponse)), + Text: fmt.Sprintf("*Estimated Tx Age*: %s", getTxAge(ctx.Context(), client, status.GetQuoteRequestResponse)), }, } @@ -257,7 +257,8 @@ func (b *Bot) rfqLookupCommand() *slacker.CommandDefinition { if err != nil { log.Println(err) } - }} + }, + } } // nolint: gocognit, cyclop. @@ -297,6 +298,24 @@ func (b *Bot) rfqRefund() *slacker.CommandDefinition { } return } + + canRefund, err := b.screener.ScreenAddress(ctx.Context(), rawRequest.Sender) + if err != nil { + _, err := ctx.Response().Reply("error screening address") + if err != nil { + log.Println(err) + } + return + } + + if !canRefund { + _, err := ctx.Response().Reply("address cannot be refunded") + if err != nil { + log.Println(err) + } + return + } + nonce, err := b.submitter.SubmitTransaction(ctx.Context(), big.NewInt(int64(rawRequest.OriginChainID)), func(transactor *bind.TransactOpts) (tx *types.Transaction, err error) { tx, err = fastBridgeContract.Refund(transactor, common.Hex2Bytes(rawRequest.QuoteRequestRaw)) if err != nil { @@ -348,7 +367,7 @@ func (b *Bot) makeFastBridge(ctx context.Context, req *relapi.GetQuoteRequestRes return fastBridgeHandle, nil } -func getTxAge(ctx context.Context, client client.EVM, res *relapi.GetQuoteRequestStatusResponse) string { +func getTxAge(ctx context.Context, client client.EVM, res *relapi.GetQuoteRequestResponse) string { // TODO: add CreatedAt field to GetQuoteRequestStatusResponse so we don't need to make network calls? receipt, err := client.TransactionReceipt(ctx, common.HexToHash(res.OriginTxHash)) if err != nil { @@ -388,19 +407,15 @@ func stripLinks(input string) string { return linkRegex.ReplaceAllString(input, "$1") } -func getQuoteRequest(ctx context.Context, client relapi.RelayerClient, tx string) (*relapi.GetQuoteRequestResponse, error) { - // at this point tx can be a txid or a has, we try both - txRequest, err := client.GetQuoteRequestStatusByTxHash(ctx, tx) - if err == nil { - // override tx with txid - tx = txRequest.TxID +func getQuoteRequest(ctx context.Context, client relapi.RelayerClient, tx string) (qr *relapi.GetQuoteRequestResponse, err error) { + if qr, err = client.GetQuoteRequestByTxHash(ctx, tx); err == nil { + return qr, nil } // look up quote request - qr, err := client.GetQuoteRequestByTXID(ctx, tx) - if err != nil { - return nil, fmt.Errorf("error fetching quote request: %w", err) + if qr, err = client.GetQuoteRequestByTXID(ctx, tx); err == nil { + return qr, nil } - return qr, nil + return nil, fmt.Errorf("error fetching quote request: %w", err) } diff --git a/contrib/opbot/botmd/commands_test.go b/contrib/opbot/botmd/commands_test.go index 26784aa7a0..b9ab0a39ee 100644 --- a/contrib/opbot/botmd/commands_test.go +++ b/contrib/opbot/botmd/commands_test.go @@ -22,7 +22,7 @@ func TestStripLinks(t *testing.T) { func TestTxAge(t *testing.T) { notExpected := "unknown time ago" // should be a definite time - status := &relapi.GetQuoteRequestStatusResponse{ + status := &relapi.GetQuoteRequestResponse{ OriginTxHash: "0x954264d120f5f3cf50edc39ebaf88ea9dc647d9d6843b7a120ed3677e23d7890", OriginChainID: 421611, } diff --git a/contrib/opbot/botmd/export_test.go b/contrib/opbot/botmd/export_test.go index 5e06c43616..79b1e7a0f2 100644 --- a/contrib/opbot/botmd/export_test.go +++ b/contrib/opbot/botmd/export_test.go @@ -11,6 +11,6 @@ func StripLinks(input string) string { return stripLinks(input) } -func GetTxAge(ctx context.Context, client client.EVM, res *relapi.GetQuoteRequestStatusResponse) string { +func GetTxAge(ctx context.Context, client client.EVM, res *relapi.GetQuoteRequestResponse) string { return getTxAge(ctx, client, res) } diff --git a/contrib/opbot/cmd/commands.go b/contrib/opbot/cmd/commands.go index 3b7001f0ad..d8d62a61c9 100644 --- a/contrib/opbot/cmd/commands.go +++ b/contrib/opbot/cmd/commands.go @@ -2,16 +2,18 @@ package cmd import ( "fmt" + "os" + "github.com/synapsecns/sanguine/contrib/opbot/botmd" "github.com/synapsecns/sanguine/core" "github.com/synapsecns/sanguine/core/metrics" // used for testing. + _ "github.com/joho/godotenv/autoload" "github.com/synapsecns/sanguine/contrib/opbot/config" "github.com/urfave/cli/v2" "gopkg.in/yaml.v3" - "os" ) var fileFlag = &cli.StringFlag{ diff --git a/contrib/opbot/config/config.go b/contrib/opbot/config/config.go index 606e413c09..cf880b6eb9 100644 --- a/contrib/opbot/config/config.go +++ b/contrib/opbot/config/config.go @@ -2,8 +2,10 @@ package config import ( + "errors" "github.com/synapsecns/sanguine/ethergo/signer/config" submitterConfig "github.com/synapsecns/sanguine/ethergo/submitter/config" + "strings" ) // Config represents the configuration of the application. @@ -31,6 +33,8 @@ type Config struct { Signer config.SignerConfig `yaml:"signer"` // SubmitterConfig is the submitter config. SubmitterConfig submitterConfig.Config `yaml:"submitter_config"` + // ScreenerConfig is the screener config. + ScreenerURL string `yaml:"screener_url"` // Database is the database config. Database DatabaseConfig `yaml:"database"` } @@ -40,3 +44,20 @@ type DatabaseConfig struct { Type string `yaml:"type"` DSN string `yaml:"dsn"` // Data Source Name } + +// Validate validates the configuration. +func (c *Config) Validate() error { + if c.SlackBotToken == "" { + return errors.New("slack_bot_token is required") + } + if !strings.HasPrefix(c.SlackBotToken, "xoxb-") { + return errors.New("slack_bot_token must start with xoxb-") + } + if c.SlackAppToken == "" { + return errors.New("slack_app_token is required") + } + if !strings.HasPrefix(c.SlackAppToken, "xapp-") { + return errors.New("slack_app_token must start with xapp-") + } + return nil +} diff --git a/contrib/opbot/go.mod b/contrib/opbot/go.mod index 4f0223aca8..e251c320ce 100644 --- a/contrib/opbot/go.mod +++ b/contrib/opbot/go.mod @@ -5,7 +5,7 @@ go 1.22.4 require ( github.com/badoux/checkmail v1.2.4 github.com/charmbracelet/huh v0.4.2 - github.com/charmbracelet/huh/spinner v0.0.0-20240618200428-90406d79077d + github.com/charmbracelet/huh/spinner v0.0.0-20240821193529-5fd70815c13f github.com/davidmytton/url-verifier v1.0.1 github.com/dubonzi/otelresty v1.3.0 github.com/dustin/go-humanize v1.0.1 @@ -14,7 +14,6 @@ require ( github.com/go-resty/resty/v2 v2.13.1 github.com/google/uuid v1.6.0 github.com/hako/durafmt v0.0.0-20210608085754-5c1018a4e16b - github.com/hedzr/log v1.6.3 github.com/ipfs/go-log v1.0.5 github.com/joho/godotenv v1.5.1 github.com/keybase/go-keychain v0.0.0-20231219164618-57a3676c3af6 @@ -22,17 +21,15 @@ require ( github.com/pkg/errors v0.9.1 github.com/prometheus/prometheus v0.53.0 github.com/slack-go/slack v0.13.0 - github.com/slack-io/slacker v0.1.0 + github.com/slack-io/slacker v0.1.1 + github.com/synapsecns/sanguine/contrib/screener-api v0.0.0-00010101000000-000000000000 github.com/synapsecns/sanguine/core v0.0.0-00010101000000-000000000000 github.com/synapsecns/sanguine/ethergo v0.1.0 github.com/synapsecns/sanguine/services/cctp-relayer v0.0.0-00010101000000-000000000000 github.com/synapsecns/sanguine/services/omnirpc v0.0.0-00010101000000-000000000000 github.com/synapsecns/sanguine/services/rfq v0.0.0-00010101000000-000000000000 github.com/urfave/cli/v2 v2.27.2 - go.opentelemetry.io/otel v1.28.0 - go.opentelemetry.io/otel/metric v1.28.0 - go.opentelemetry.io/otel/trace v1.28.0 - golang.org/x/sync v0.7.0 + golang.org/x/sync v0.8.0 gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 gorm.io/driver/mysql v1.5.6 @@ -86,12 +83,12 @@ require ( github.com/catppuccin/go v0.2.0 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/charmbracelet/bubbles v0.18.0 // indirect - github.com/charmbracelet/bubbletea v0.26.5 // indirect - github.com/charmbracelet/lipgloss v0.11.0 // indirect - github.com/charmbracelet/x/ansi v0.1.2 // indirect + github.com/charmbracelet/bubbles v0.19.0 // indirect + github.com/charmbracelet/bubbletea v0.27.0 // indirect + github.com/charmbracelet/lipgloss v0.13.0 // indirect + github.com/charmbracelet/x/ansi v0.1.4 // indirect github.com/charmbracelet/x/exp/strings v0.0.0-20240524151031-ff83003bf67a // indirect - github.com/charmbracelet/x/input v0.1.2 // indirect + github.com/charmbracelet/x/input v0.1.3 // indirect github.com/charmbracelet/x/term v0.1.1 // indirect github.com/charmbracelet/x/windows v0.1.2 // indirect github.com/cloudflare/circl v1.3.7 // indirect @@ -162,6 +159,7 @@ require ( github.com/grafana/regexp v0.0.0-20240518133315-a468a5bfb3bc // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/hedzr/log v1.6.3 // indirect github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7 // indirect github.com/holiman/bloomfilter/v2 v2.0.3 // indirect github.com/holiman/uint256 v1.2.4 // indirect @@ -190,7 +188,7 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-localereader v0.0.1 // indirect - github.com/mattn/go-runewidth v0.0.15 // indirect + github.com/mattn/go-runewidth v0.0.16 // indirect github.com/mattn/go-sqlite3 v2.0.3+incompatible // indirect github.com/mattn/go-tty v0.0.3 // indirect github.com/miguelmota/go-ethereum-hdwallet v0.1.1 // indirect @@ -254,28 +252,31 @@ require ( go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 // indirect go.opentelemetry.io/contrib/propagators/b3 v1.28.0 // indirect + go.opentelemetry.io/otel v1.28.0 // indirect go.opentelemetry.io/otel/exporters/jaeger v1.17.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect go.opentelemetry.io/otel/log v0.3.0 // indirect + go.opentelemetry.io/otel/metric v1.28.0 // indirect go.opentelemetry.io/otel/sdk v1.28.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.28.0 // indirect + go.opentelemetry.io/otel/trace v1.28.0 // indirect go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/arch v0.8.0 // indirect - golang.org/x/crypto v0.24.0 // indirect - golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect - golang.org/x/mod v0.19.0 // indirect - golang.org/x/net v0.26.0 // indirect + golang.org/x/crypto v0.26.0 // indirect + golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 // indirect + golang.org/x/mod v0.20.0 // indirect + golang.org/x/net v0.28.0 // indirect golang.org/x/oauth2 v0.21.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/text v0.16.0 // indirect + golang.org/x/sys v0.24.0 // indirect + golang.org/x/text v0.17.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.22.0 // indirect + golang.org/x/tools v0.24.0 // indirect google.golang.org/api v0.183.0 // indirect google.golang.org/genproto v0.0.0-20240528184218-531527333157 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect @@ -294,7 +295,7 @@ replace ( // later versions give errors on uint64 being too high. github.com/brianvoe/gofakeit/v6 => github.com/brianvoe/gofakeit/v6 v6.9.0 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 - github.com/slack-io/slacker => github.com/slack-io/slacker v0.1.1-0.20240701203341-bd3ee211e9d2 + github.com/synapsecns/sanguine/contrib/screener-api => ./../../contrib/screener-api github.com/synapsecns/sanguine/core => ./../../core github.com/synapsecns/sanguine/ethergo => ./../../ethergo github.com/synapsecns/sanguine/services/cctp-relayer => ./../../services/cctp-relayer diff --git a/contrib/opbot/go.sum b/contrib/opbot/go.sum index be0ee5c6ef..79003abbc7 100644 --- a/contrib/opbot/go.sum +++ b/contrib/opbot/go.sum @@ -76,6 +76,8 @@ github.com/ImVexed/fasturl v0.0.0-20230304231329-4e41488060f3/go.mod h1:we0YA5Cs github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= +github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ= +github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= @@ -225,24 +227,24 @@ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/charmbracelet/bubbles v0.18.0 h1:PYv1A036luoBGroX6VWjQIE9Syf2Wby2oOl/39KLfy0= -github.com/charmbracelet/bubbles v0.18.0/go.mod h1:08qhZhtIwzgrtBjAcJnij1t1H0ZRjwHyGsy6AL11PSw= -github.com/charmbracelet/bubbletea v0.26.5 h1:90pqTPElAReb/qQUgSMUresTkfwVr0Wx+zczeHHOgxk= -github.com/charmbracelet/bubbletea v0.26.5/go.mod h1:dz8CWPlfCCGLFbBlTY4N7bjLiyOGDJEnd2Muu7pOWhk= +github.com/charmbracelet/bubbles v0.19.0 h1:gKZkKXPP6GlDk6EcfujDK19PCQqRjaJZQ7QRERx1UF0= +github.com/charmbracelet/bubbles v0.19.0/go.mod h1:WILteEqZ+krG5c3ntGEMeG99nCupcuIk7V0/zOP0tOA= +github.com/charmbracelet/bubbletea v0.27.0 h1:Mznj+vvYuYagD9Pn2mY7fuelGvP0HAXtZYGgRBCbHvU= +github.com/charmbracelet/bubbletea v0.27.0/go.mod h1:5MdP9XH6MbQkgGhnlxUqCNmBXf9I74KRQ8HIidRxV1Y= github.com/charmbracelet/huh v0.4.2 h1:5wLkwrA58XDAfEZsJzNQlfJ+K8N9+wYwvR5FOM7jXFM= github.com/charmbracelet/huh v0.4.2/go.mod h1:g9OXBgtY3zRV4ahnVih9bZE+1yGYN+y2C9Q6L2P+WM0= -github.com/charmbracelet/huh/spinner v0.0.0-20240618200428-90406d79077d h1:OpthCCWiHBSx6LTAYGGkN9OeuJrKzjobe0q12wO6BX0= -github.com/charmbracelet/huh/spinner v0.0.0-20240618200428-90406d79077d/go.mod h1:CrXBZnOWs3zpyppOZZS7lu2CpLq2jx6U5chL/frRG/E= -github.com/charmbracelet/lipgloss v0.11.0 h1:UoAcbQ6Qml8hDwSWs0Y1cB5TEQuZkDPH/ZqwWWYTG4g= -github.com/charmbracelet/lipgloss v0.11.0/go.mod h1:1UdRTH9gYgpcdNN5oBtjbu/IzNKtzVtb7sqN1t9LNn8= -github.com/charmbracelet/x/ansi v0.1.2 h1:6+LR39uG8DE6zAmbu023YlqjJHkYXDF1z36ZwzO4xZY= -github.com/charmbracelet/x/ansi v0.1.2/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw= +github.com/charmbracelet/huh/spinner v0.0.0-20240821193529-5fd70815c13f h1:i94e1l91SP1q7HAyAaT3pziIGIS1Q/Lvg/gaAWbr2Kc= +github.com/charmbracelet/huh/spinner v0.0.0-20240821193529-5fd70815c13f/go.mod h1:1fSCfCxE3BGKFb3v+ta8bQHC5kcyPUA65zdVWBMzthE= +github.com/charmbracelet/lipgloss v0.13.0 h1:4X3PPeoWEDCMvzDvGmTajSyYPcZM4+y8sCA/SsA3cjw= +github.com/charmbracelet/lipgloss v0.13.0/go.mod h1:nw4zy0SBX/F/eAO1cWdcvy6qnkDUxr8Lw7dvFrAIbbY= +github.com/charmbracelet/x/ansi v0.1.4 h1:IEU3D6+dWwPSgZ6HBH+v6oUuZ/nVawMiWj5831KfiLM= +github.com/charmbracelet/x/ansi v0.1.4/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw= github.com/charmbracelet/x/exp/strings v0.0.0-20240524151031-ff83003bf67a h1:lOpqe2UvPmlln41DGoii7wlSZ/q8qGIon5JJ8Biu46I= github.com/charmbracelet/x/exp/strings v0.0.0-20240524151031-ff83003bf67a/go.mod h1:pBhA0ybfXv6hDjQUZ7hk1lVxBiUbupdw5R31yPUViVQ= github.com/charmbracelet/x/exp/term v0.0.0-20240524151031-ff83003bf67a h1:k/s6UoOSVynWiw7PlclyGO2VdVs5ZLbMIHiGp4shFZE= github.com/charmbracelet/x/exp/term v0.0.0-20240524151031-ff83003bf67a/go.mod h1:YBotIGhfoWhHDlnUpJMkjebGV2pdGRCn1Y4/Nk/vVcU= -github.com/charmbracelet/x/input v0.1.2 h1:QJAZr33eOhDowkkEQ24rsJy4Llxlm+fRDf/cQrmqJa0= -github.com/charmbracelet/x/input v0.1.2/go.mod h1:LGBim0maUY4Pitjn/4fHnuXb4KirU3DODsyuHuXdOyA= +github.com/charmbracelet/x/input v0.1.3 h1:oy4TMhyGQsYs/WWJwu1ELUMFnjiUAXwtDf048fHbCkg= +github.com/charmbracelet/x/input v0.1.3/go.mod h1:1gaCOyw1KI9e2j00j/BBZ4ErzRZqa05w0Ghn83yIhKU= github.com/charmbracelet/x/term v0.1.1 h1:3cosVAiPOig+EV4X9U+3LDgtwwAoEzJjNdwbXDjF6yI= github.com/charmbracelet/x/term v0.1.1/go.mod h1:wB1fHt5ECsu3mXYusyzcngVWWlu1KKUmmLhfgr/Flxw= github.com/charmbracelet/x/windows v0.1.2 h1:Iumiwq2G+BRmgoayww/qfcvof7W/3uLoelhxojXlRWg= @@ -799,8 +801,8 @@ github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+Ei github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= -github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= +github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U= github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= @@ -1024,8 +1026,8 @@ github.com/slack-io/commander v0.0.0-20231120025847-9fd78b4b2d54 h1:aRc+G2mUb697 github.com/slack-io/commander v0.0.0-20231120025847-9fd78b4b2d54/go.mod h1:aHmXZnL/ELKlfMybblXnnCl+IeHQ+gMb++DT7ujIGlA= github.com/slack-io/proper v0.0.0-20231119200853-f78ba4fc878f h1:wiEJBKJKvMOeE9KtLV7iwtHOsNXDBZloL+FPlkZ6vnA= github.com/slack-io/proper v0.0.0-20231119200853-f78ba4fc878f/go.mod h1:q+erLGESzGsEP/cJeGoDxfdLKDstT4caj/JvAShLEt4= -github.com/slack-io/slacker v0.1.1-0.20240701203341-bd3ee211e9d2 h1:+ZbW5lFQj1CyetlFrrd4KmNCxfSxzTX873PrZSkRoDc= -github.com/slack-io/slacker v0.1.1-0.20240701203341-bd3ee211e9d2/go.mod h1:0dIY7rxW5j4aSRq+rg79dpg3My012uZdGrzFmewSKUA= +github.com/slack-io/slacker v0.1.1 h1:/44qwaM8HxspLVvSEE7ue4LcKkUyYxIOhraaOWTrBMY= +github.com/slack-io/slacker v0.1.1/go.mod h1:0dIY7rxW5j4aSRq+rg79dpg3My012uZdGrzFmewSKUA= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= @@ -1240,8 +1242,8 @@ golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2Uz golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1252,8 +1254,8 @@ golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm0 golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 h1:yixxcjnhBmY0nkL253HFVIm0JsFHwrHdT3Yh6szTnfY= -golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8/go.mod h1:jj3sYF3dwk5D+ghuXyeI3r5MFf+NT2An6/9dOA95KSI= +golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 h1:kx6Ds3MlpiUHKj7syVnbp57++8WpuKPcR5yjLBjvLEA= +golang.org/x/exp v0.0.0-20240823005443-9b4947da3948/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -1276,8 +1278,8 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= -golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= +golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1317,8 +1319,8 @@ golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1337,8 +1339,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1405,8 +1407,8 @@ golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= @@ -1415,8 +1417,8 @@ golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= +golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -1431,8 +1433,8 @@ golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1477,8 +1479,8 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= -golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/contrib/opbot/icon.png b/contrib/opbot/icon.png new file mode 100644 index 0000000000..d1835255e1 Binary files /dev/null and b/contrib/opbot/icon.png differ diff --git a/contrib/opbot/manifest.json b/contrib/opbot/manifest.json new file mode 100644 index 0000000000..139d97bf52 --- /dev/null +++ b/contrib/opbot/manifest.json @@ -0,0 +1,47 @@ +{ + "display_information": { + "name": "OpBot" + }, + "features": { + "app_home": { + "home_tab_enabled": true, + "messages_tab_enabled": false, + "messages_tab_read_only_enabled": false + }, + "bot_user": { + "display_name": "OpBot", + "always_online": true + } + }, + "oauth_config": { + "scopes": { + "bot": [ + "app_mentions:read", + "channels:history", + "chat:write", + "groups:history", + "im:history", + "im:read", + "im:write", + "mpim:history", + "users:read", + "usergroups:read" + ] + } + }, + "settings": { + "event_subscriptions": { + "bot_events": [ + "app_mention", + "message.im", + "message.mpim" + ] + }, + "interactivity": { + "is_enabled": true + }, + "org_deploy_enabled": false, + "socket_mode_enabled": true, + "token_rotation_enabled": false + } +} diff --git a/contrib/promexporter/config/config.go b/contrib/promexporter/config/config.go index f798dd9c99..16ba029f83 100644 --- a/contrib/promexporter/config/config.go +++ b/contrib/promexporter/config/config.go @@ -3,29 +3,32 @@ package config import ( "fmt" + "os" + "path/filepath" + "github.com/creasty/defaults" "github.com/jftuga/ellipsis" "github.com/synapsecns/sanguine/contrib/promexporter/internal/types" "gopkg.in/yaml.v2" - "os" - "path/filepath" ) -// Config contains the config for the prometheues exporter. type Config struct { // Port is the port of the config Port int `yaml:"port"` // DFKApiUrl is the url of the DFK API - DFKUrl string `yaml:"dfk_url" default:"https://defi-kingdoms-community-api-gateway-co06z8vi.uc.gateway.dev/graphql"` + DFKUrl string `default:"https://defi-kingdoms-community-api-gateway-co06z8vi.uc.gateway.dev/graphql" yaml:"dfk_url"` // DFKPending is the list of pending heroes DFKPending []DFKPending `yaml:"dfk_pending"` // SubmitterChecks is the list of gas checks SubmitterChecks []SubmitterChecks `yaml:"gas_checks"` - OmnirpcURL string `yaml:"omnirpc_url" default:"https://rpc.omnirpc.io"` - // map chainid->address - BridgeChecks map[int]string + // OmniRpcURL is the url of the omnirpc + OmnirpcURL string `default:"https://rpc.omnirpc.io" yaml:"omnirpc_url"` // VpriceCheckTokens is the list of tokens to check vprice for VpriceCheckTokens []string `yaml:"vprice_tokens"` + // RFQAPIURL is the url of the RFQ API + RFQAPIUrl string `default:"http://rfq-api.omnirpc.io/quotes" yaml:"rfq_api_url"` + // map chainid->address + BridgeChecks map[int]string // BridgeConfig is the config for the bridge. BridgeConfig BridgeConfig // BatchCallLimit is the limit of batch calls diff --git a/contrib/promexporter/exporters/exporter.go b/contrib/promexporter/exporters/exporter.go index 01010bc52e..813a15c025 100644 --- a/contrib/promexporter/exporters/exporter.go +++ b/contrib/promexporter/exporters/exporter.go @@ -121,12 +121,16 @@ func (e *exporter) recordMetrics(ctx context.Context) (err error) { // nolint: cyclop func (e *exporter) collectMetrics(ctx context.Context) error { var errs []error + + if err := e.fetchRelayerBalances(ctx, e.cfg.RFQAPIUrl); err != nil { + errs = append(errs, fmt.Errorf("could not fetch relayer balances: %w", err)) + } + if err := e.getTokenBalancesStats(ctx); err != nil { errs = append(errs, fmt.Errorf("could not get token balances: %w", err)) } // TODO: parallelize - for _, pending := range e.cfg.DFKPending { if err := e.stuckHeroCountStats(ctx, common.HexToAddress(pending.Owner), pending.ChainName); err != nil { errs = append(errs, fmt.Errorf("could not get stuck hero count: %w", err)) diff --git a/contrib/promexporter/exporters/otel.go b/contrib/promexporter/exporters/otel.go index 30df77544e..0ff20d7fb4 100644 --- a/contrib/promexporter/exporters/otel.go +++ b/contrib/promexporter/exporters/otel.go @@ -20,6 +20,12 @@ type submitterMetadata struct { balance float64 } +type relayerMetadata struct { + address common.Address + balance float64 + usdcBalance float64 +} + //go:generate go run github.com/vburenin/ifacemaker -f otel.go -s otelRecorder -i iOtelRecorder -p exporters -o otel_generated.go -c "autogenerated file" type otelRecorder struct { metrics metrics.Handler @@ -48,19 +54,25 @@ type otelRecorder struct { submitters *hashmap.Map[int, []submitterMetadata] balanceGauge metric.Float64ObservableGauge nonceGauge metric.Int64ObservableGauge + + // relayer stats + relayerBalance *hashmap.Map[int, []relayerMetadata] + relayerBalanceGauge metric.Float64ObservableGauge + relayerUSDCBalanceGuage metric.Float64ObservableGauge } // TODO: unexport all methods. // nolint: cyclop func newOtelRecorder(meterHandler metrics.Handler) iOtelRecorder { otr := otelRecorder{ - metrics: meterHandler, - meter: meterHandler.Meter(meterName), - stuckHeroes: hashmap.New[string, int64](), - vPrice: hashmap.New[int, float64](), - gasBalance: hashmap.New[int, float64](), - td: hashmap.New[int, []tokenData](), - submitters: hashmap.New[int, []submitterMetadata](), + metrics: meterHandler, + meter: meterHandler.Meter(meterName), + stuckHeroes: hashmap.New[string, int64](), + vPrice: hashmap.New[int, float64](), + gasBalance: hashmap.New[int, float64](), + td: hashmap.New[int, []tokenData](), + submitters: hashmap.New[int, []submitterMetadata](), + relayerBalance: hashmap.New[int, []relayerMetadata](), } var err error @@ -96,6 +108,14 @@ func newOtelRecorder(meterHandler metrics.Handler) iOtelRecorder { log.Warnf("failed to create stuckHeroes gauge: %v", err) } + if otr.relayerBalanceGauge, err = otr.meter.Float64ObservableGauge("relayer_balance"); err != nil { + log.Warnf("failed to create relayerBalance gauge: %v", err) + } + + if otr.relayerUSDCBalanceGuage, err = otr.meter.Float64ObservableGauge("relayer_usdc_balance"); err != nil { + log.Warnf("failed to create relayerUSDCBalance gauge: %v", err) + } + // Register VPrice callback if _, err = otr.meter.RegisterCallback(otr.recordVpriceGauge, otr.vpriceGauge); err != nil { log.Warnf("failed to register callback for vprice metrics: %v", err) @@ -125,6 +145,11 @@ func newOtelRecorder(meterHandler metrics.Handler) iOtelRecorder { log.Warnf("failed to register callback for bridge gas balance metrics: %v", err) } + // The Relayer code of interest. + if _, err = otr.meter.RegisterCallback(otr.recordRelayerBalance, otr.relayerBalanceGauge, otr.relayerUSDCBalanceGuage); err != nil { + log.Warnf("failed to register callback for relayer balance metrics: %v", err) + } + return &otr } @@ -195,6 +220,7 @@ func (o *otelRecorder) RecordTokenBalance( o.td.Set(chainID, td) } + func (o *otelRecorder) recordTokenBalance( _ context.Context, observer metric.Observer, @@ -310,3 +336,44 @@ func (o *otelRecorder) recordSubmitterStats( }) return nil } + +// RELAYER CODE. +func (o *otelRecorder) RecordRelayerBalance(chainID int, relayer relayerMetadata) { + relayerBalances, _ := o.relayerBalance.Get(chainID) + relayerBalances = append(relayerBalances, relayer) + o.relayerBalance.Set(chainID, relayerBalances) +} + +func (o *otelRecorder) recordRelayerBalance( + _ context.Context, + observer metric.Observer, +) (err error) { + if o.metrics == nil || o.relayerBalance == nil { + return nil + } + + o.relayerBalance.Range(func(chainID int, relayerBalances []relayerMetadata) bool { + for _, relayer := range relayerBalances { + observer.ObserveFloat64( + o.relayerBalanceGauge, + relayer.balance, + metric.WithAttributes( + attribute.Int(metrics.ChainID, chainID), + attribute.String("relayer_address", relayer.address.String()), + ), + ) + observer.ObserveFloat64( + o.relayerUSDCBalanceGuage, + relayer.usdcBalance, + metric.WithAttributes( + attribute.Int(metrics.ChainID, chainID), + attribute.String("relayer_address", relayer.address.String()), + ), + ) + } + + return true + }) + + return nil +} diff --git a/contrib/promexporter/exporters/otel_generated.go b/contrib/promexporter/exporters/otel_generated.go index 1c42e04db0..37445e8a54 100644 --- a/contrib/promexporter/exporters/otel_generated.go +++ b/contrib/promexporter/exporters/otel_generated.go @@ -13,4 +13,6 @@ type iOtelRecorder interface { RecordStuckHeroCount(stuckHeroes int64, chainname string) // Submitter stats. RecordSubmitterStats(chainid int, metadata submitterMetadata) + // RELAYER CODE. + RecordRelayerBalance(chainID int, relayer relayerMetadata) } diff --git a/contrib/promexporter/exporters/relayer.go b/contrib/promexporter/exporters/relayer.go new file mode 100644 index 0000000000..d5909e439b --- /dev/null +++ b/contrib/promexporter/exporters/relayer.go @@ -0,0 +1,130 @@ +package exporters + +import ( + "context" + "encoding/json" + "fmt" + "io" + "math/big" + "net/http" + "slices" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/params" + "github.com/lmittmann/w3/module/eth" + "github.com/lmittmann/w3/w3types" + "github.com/synapsecns/sanguine/contrib/promexporter/internal/decoders" + rfqAPIModel "github.com/synapsecns/sanguine/services/rfq/api/model" +) + +// TODO: This is ugly. We can probably get this from the config. +var usdcAddresses = map[int]string{ + 1: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", + 10: "0x0b2c639c533813f4aa9d7837caf62653d097ff85", + 42161: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + 8453: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + 534352: "0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4", + 59144: "0x176211869cA2b568f2A7D4EE941E073a821EE1ff", +} + +// TODO: this function does too many things. +// +//nolint:cyclop +func (e *exporter) fetchRelayerBalances(ctx context.Context, url string) error { + // Fetch relayer addresses + quotes, err := e.fetchAllQuotes(ctx, url) + if err != nil { + return fmt.Errorf("could not fetch relayer addresses: %w", err) + } + + // chainIDs is a map of chain ID to relayer addresses + chainIDToRelayers := make(map[int][]string) + + // Get all chain IDs + for _, quote := range quotes { + if !slices.Contains(chainIDToRelayers[quote.OriginChainID], quote.RelayerAddr) { + chainIDToRelayers[quote.OriginChainID] = append(chainIDToRelayers[quote.OriginChainID], quote.RelayerAddr) + } + + if !slices.Contains(chainIDToRelayers[quote.DestChainID], quote.RelayerAddr) { + chainIDToRelayers[quote.DestChainID] = append(chainIDToRelayers[quote.DestChainID], quote.RelayerAddr) + } + } + + for chainID := range chainIDToRelayers { + chainIDToRelayers[chainID] = append(chainIDToRelayers[chainID], "0x2156BfA195C033CA2DF4Ff14e6Da0c617B8cb4F7") + } + + for chainID, relayers := range chainIDToRelayers { + client, err := e.omnirpcClient.GetConfirmationsClient(ctx, chainID, 1) + if err != nil { + return fmt.Errorf("could not get confirmations client: %w", err) + } + + var relayerBalances []*big.Int + var usdcBalances []*big.Int + for range relayers { + relayerBalances = append(relayerBalances, new(big.Int)) + usdcBalances = append(usdcBalances, new(big.Int)) + } + + var callsForCurrentChainID []w3types.Caller + for i, relayer := range relayers { + callsForCurrentChainID = append( + callsForCurrentChainID, + eth.Balance(common.HexToAddress(relayer), nil).Returns(relayerBalances[i]), + ) + callsForCurrentChainID = append( + callsForCurrentChainID, + eth.CallFunc( + decoders.FuncBalanceOf(), + common.HexToAddress(usdcAddresses[chainID]), + common.HexToAddress(relayer)).Returns(usdcBalances[i]), + ) + } + + _ = e.batchCalls(ctx, client, callsForCurrentChainID) + + for i := range relayerBalances { + balanceFloat, _ := new(big.Float).SetInt(relayerBalances[i]).Float64() + usdcBalanceFloat, _ := new(big.Float).SetInt(usdcBalances[i]).Float64() + relayerMetadata := relayerMetadata{ + address: common.HexToAddress(relayers[i]), + balance: balanceFloat / params.Ether, + usdcBalance: usdcBalanceFloat / 1e6, + } + // the line of interest, where we record each relayer data for the respective chainID + e.otelRecorder.RecordRelayerBalance(chainID, relayerMetadata) + } + } + + return nil +} + +func (e *exporter) fetchAllQuotes(ctx context.Context, url string) ([]rfqAPIModel.GetQuoteResponse, error) { + req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil) + if err != nil { + return nil, fmt.Errorf("could not get quotes: %w", err) + } + + res, err := e.client.Do(req) + if err != nil { + return nil, fmt.Errorf("could not get quotes: %w", err) + } + defer func() { + _ = res.Body.Close() + }() + + body, err := io.ReadAll(res.Body) + if err != nil { + return nil, fmt.Errorf("could not read body: %w", err) + } + + var quotes []rfqAPIModel.GetQuoteResponse + err = json.Unmarshal(body, "es) + if err != nil { + return nil, fmt.Errorf("could not unmarshal quotes: %w", err) + } + + return quotes, nil +} diff --git a/contrib/promexporter/go.mod b/contrib/promexporter/go.mod index 8bfc4e4cd1..0f529607c2 100644 --- a/contrib/promexporter/go.mod +++ b/contrib/promexporter/go.mod @@ -36,11 +36,12 @@ require ( github.com/synapsecns/sanguine/ethergo v0.1.0 github.com/synapsecns/sanguine/services/explorer v0.0.0-00010101000000-000000000000 github.com/synapsecns/sanguine/services/omnirpc v0.0.0-00010101000000-000000000000 + github.com/synapsecns/sanguine/services/rfq v1.8.0 github.com/urfave/cli/v2 v2.27.2 go.opentelemetry.io/otel v1.28.0 go.opentelemetry.io/otel/metric v1.28.0 go.opentelemetry.io/otel/trace v1.28.0 - golang.org/x/sync v0.7.0 + golang.org/x/sync v0.8.0 gopkg.in/yaml.v2 v2.4.0 ) @@ -157,7 +158,7 @@ require ( github.com/libp2p/go-libp2p v0.33.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.15 // indirect + github.com/mattn/go-runewidth v0.0.16 // indirect github.com/mattn/go-tty v0.0.3 // indirect github.com/miguelmota/go-ethereum-hdwallet v0.1.1 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect @@ -230,14 +231,14 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/arch v0.8.0 // indirect - golang.org/x/crypto v0.24.0 // indirect - golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect - golang.org/x/mod v0.19.0 // indirect - golang.org/x/net v0.26.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/text v0.16.0 // indirect + golang.org/x/crypto v0.26.0 // indirect + golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 // indirect + golang.org/x/mod v0.20.0 // indirect + golang.org/x/net v0.28.0 // indirect + golang.org/x/sys v0.24.0 // indirect + golang.org/x/text v0.17.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.22.0 // indirect + golang.org/x/tools v0.24.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect google.golang.org/grpc v1.64.0 // indirect diff --git a/contrib/promexporter/go.sum b/contrib/promexporter/go.sum index 80d1d0ea66..797cdebbbd 100644 --- a/contrib/promexporter/go.sum +++ b/contrib/promexporter/go.sum @@ -776,8 +776,8 @@ github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= -github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= +github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U= github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= @@ -1033,6 +1033,8 @@ github.com/synapsecns/fasthttp-http2 v1.0.0 h1:G1/8AKgAzVImHpGbCGZo8w4c0kUBXb4eR github.com/synapsecns/fasthttp-http2 v1.0.0/go.mod h1:QM9mQS/FygGB3PdvmW8a0/70FirWmEZVvj6Dlo1pisw= github.com/synapsecns/gqlgenc v0.10.0-hotfix h1:EkxocO6V/xRcHJ+1sNY+fwDY5l1/jL9qooPEpWzrbLg= github.com/synapsecns/gqlgenc v0.10.0-hotfix/go.mod h1:OeQhghEgvGWvRwzx9XjMeg3FUQOHnTo5/12iuJSJxLg= +github.com/synapsecns/sanguine/services/rfq v1.8.0 h1:0s5ywpXMbtcoKGD3E00pPWa/OAHQi07l2+tHEpbbNSE= +github.com/synapsecns/sanguine/services/rfq v1.8.0/go.mod h1:1jtien0M/VFz/2hzr/YHCkd8WxPOIWVNZ+47sGB+Gl8= github.com/syndtr/goleveldb v1.0.1-0.20210305035536-64b5b1c73954/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= @@ -1214,8 +1216,8 @@ golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1229,8 +1231,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 h1:yixxcjnhBmY0nkL253HFVIm0JsFHwrHdT3Yh6szTnfY= -golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8/go.mod h1:jj3sYF3dwk5D+ghuXyeI3r5MFf+NT2An6/9dOA95KSI= +golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 h1:kx6Ds3MlpiUHKj7syVnbp57++8WpuKPcR5yjLBjvLEA= +golang.org/x/exp v0.0.0-20240823005443-9b4947da3948/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -1259,8 +1261,8 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= -golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= +golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1310,8 +1312,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1336,8 +1338,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1418,15 +1420,15 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= +golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1439,8 +1441,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1510,8 +1512,8 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= -golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/contrib/screener-api/go.mod b/contrib/screener-api/go.mod index 41551f76bf..97b66d198e 100644 --- a/contrib/screener-api/go.mod +++ b/contrib/screener-api/go.mod @@ -29,7 +29,7 @@ require ( go.opentelemetry.io/otel v1.28.0 go.opentelemetry.io/otel/metric v1.28.0 go.opentelemetry.io/otel/trace v1.28.0 - golang.org/x/sync v0.7.0 + golang.org/x/sync v0.8.0 gopkg.in/yaml.v2 v2.4.0 gorm.io/driver/mysql v1.5.6 gorm.io/driver/sqlite v1.5.6 @@ -39,7 +39,6 @@ require ( require ( dario.cat/mergo v1.0.0 // indirect github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect - github.com/BurntSushi/toml v1.4.0 // indirect github.com/ImVexed/fasturl v0.0.0-20230304231329-4e41488060f3 // indirect github.com/KyleBanks/depth v1.2.1 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect @@ -119,7 +118,7 @@ require ( github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.15 // indirect + github.com/mattn/go-runewidth v0.0.16 // indirect github.com/mattn/go-sqlite3 v2.0.3+incompatible // indirect github.com/mattn/go-tty v0.0.3 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect @@ -182,14 +181,14 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/arch v0.8.0 // indirect - golang.org/x/crypto v0.24.0 // indirect - golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect - golang.org/x/mod v0.19.0 // indirect - golang.org/x/net v0.26.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/text v0.16.0 // indirect + golang.org/x/crypto v0.26.0 // indirect + golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 // indirect + golang.org/x/mod v0.20.0 // indirect + golang.org/x/net v0.28.0 // indirect + golang.org/x/sys v0.24.0 // indirect + golang.org/x/text v0.17.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.22.0 // indirect + golang.org/x/tools v0.24.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect google.golang.org/grpc v1.64.0 // indirect diff --git a/contrib/screener-api/go.sum b/contrib/screener-api/go.sum index 3aca8ecf3b..30059c8d49 100644 --- a/contrib/screener-api/go.sum +++ b/contrib/screener-api/go.sum @@ -42,6 +42,7 @@ github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOEl github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0= +github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Flaque/filet v0.0.0-20201012163910-45f684403088 h1:PnnQln5IGbhLeJOi6hVs+lCeF+B1dRfFKPGXUAez0Ww= github.com/Flaque/filet v0.0.0-20201012163910-45f684403088/go.mod h1:TK+jB3mBs+8ZMWhU5BqZKnZWJ1MrLo8etNVg51ueTBo= @@ -185,6 +186,7 @@ github.com/gliderlabs/ssh v0.3.7 h1:iV3Bqi942d9huXnzEF2Mt+CY9gLu8DNM4Obd+8bODRE= github.com/gliderlabs/ssh v0.3.7/go.mod h1:zpHEXBstFnQYtGnB8k8kQLol82umzn/2/snG7alWVD8= github.com/go-errors/errors v1.4.1/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= @@ -321,6 +323,7 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU= github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= @@ -390,8 +393,8 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= -github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= +github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U= github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-tty v0.0.3 h1:5OfyWorkyO7xP52Mq7tB36ajHDG5OHrmBGIS/DtakQI= @@ -635,8 +638,8 @@ golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2Uz golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -647,8 +650,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 h1:yixxcjnhBmY0nkL253HFVIm0JsFHwrHdT3Yh6szTnfY= -golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8/go.mod h1:jj3sYF3dwk5D+ghuXyeI3r5MFf+NT2An6/9dOA95KSI= +golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 h1:kx6Ds3MlpiUHKj7syVnbp57++8WpuKPcR5yjLBjvLEA= +golang.org/x/exp v0.0.0-20240823005443-9b4947da3948/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -675,8 +678,8 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= -golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= +golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -718,8 +721,8 @@ golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -742,8 +745,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -813,8 +816,8 @@ golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= @@ -823,8 +826,8 @@ golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= +golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -839,8 +842,8 @@ golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -901,8 +904,8 @@ golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= -golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/core/go.mod b/core/go.mod index dc06b1459e..4f6e5bffcd 100644 --- a/core/go.mod +++ b/core/go.mod @@ -27,6 +27,7 @@ require ( github.com/google/uuid v1.6.0 github.com/grafana/otel-profiling-go v0.5.1 github.com/grafana/pyroscope-go v1.1.1 + github.com/hedzr/log v1.6.3 github.com/integralist/go-findroot v0.0.0-20160518114804-ac90681525dc github.com/ipfs/go-log v1.0.5 github.com/jpillora/backoff v1.0.0 @@ -38,6 +39,7 @@ require ( github.com/rung/go-safecast v1.0.1 github.com/samborkent/uuid v0.0.0-20240324164324-079317f91359 github.com/shibukawa/configdir v0.0.0-20170330084843-e180dbdc8da0 + github.com/slack-io/slacker v0.1.1 github.com/stretchr/testify v1.9.0 github.com/temoto/robotstxt v1.1.2 github.com/uptrace/opentelemetry-go-extra/otelgorm v0.3.1 @@ -60,7 +62,7 @@ require ( go.opentelemetry.io/otel/trace v1.28.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.27.0 - golang.org/x/sync v0.7.0 + golang.org/x/sync v0.8.0 gorm.io/driver/sqlite v1.5.6 gorm.io/gorm v1.25.10 k8s.io/apimachinery v0.29.3 @@ -130,7 +132,7 @@ require ( github.com/lib/pq v1.10.6 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.15 // indirect + github.com/mattn/go-runewidth v0.0.16 // indirect github.com/mattn/go-sqlite3 v2.0.3+incompatible // indirect github.com/mattn/go-tty v0.0.3 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect @@ -151,11 +153,15 @@ require ( github.com/prometheus/common v0.54.0 // indirect github.com/prometheus/procfs v0.15.0 // indirect github.com/rivo/uniseg v0.4.7 // indirect + github.com/robfig/cron/v3 v3.0.1 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/skeema/knownhosts v1.2.2 // indirect + github.com/slack-go/slack v0.13.0 // indirect + github.com/slack-io/commander v0.0.0-20231120025847-9fd78b4b2d54 // indirect + github.com/slack-io/proper v0.0.0-20231119200853-f78ba4fc878f // indirect github.com/spf13/afero v1.10.0 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.8.0 // indirect @@ -173,14 +179,14 @@ require ( go.opentelemetry.io/otel/log v0.3.0 // indirect go.opentelemetry.io/proto/otlp v1.3.1 // indirect golang.org/x/arch v0.8.0 // indirect - golang.org/x/crypto v0.24.0 // indirect - golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect - golang.org/x/mod v0.19.0 // indirect - golang.org/x/net v0.26.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/text v0.16.0 // indirect + golang.org/x/crypto v0.26.0 // indirect + golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 // indirect + golang.org/x/mod v0.20.0 // indirect + golang.org/x/net v0.28.0 // indirect + golang.org/x/sys v0.24.0 // indirect + golang.org/x/text v0.17.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.22.0 // indirect + golang.org/x/tools v0.24.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect google.golang.org/grpc v1.64.0 // indirect diff --git a/core/go.sum b/core/go.sum index ab4d9782ce..81f64a25d3 100644 --- a/core/go.sum +++ b/core/go.sum @@ -42,6 +42,7 @@ github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOEl github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0= +github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Flaque/filet v0.0.0-20201012163910-45f684403088 h1:PnnQln5IGbhLeJOi6hVs+lCeF+B1dRfFKPGXUAez0Ww= github.com/Flaque/filet v0.0.0-20201012163910-45f684403088/go.mod h1:TK+jB3mBs+8ZMWhU5BqZKnZWJ1MrLo8etNVg51ueTBo= @@ -185,6 +186,7 @@ github.com/gliderlabs/ssh v0.3.7 h1:iV3Bqi942d9huXnzEF2Mt+CY9gLu8DNM4Obd+8bODRE= github.com/gliderlabs/ssh v0.3.7/go.mod h1:zpHEXBstFnQYtGnB8k8kQLol82umzn/2/snG7alWVD8= github.com/go-errors/errors v1.4.1/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= @@ -221,6 +223,8 @@ github.com/go-playground/validator/v10 v10.20.0 h1:K9ISHbSaI0lyB2eWMPJo+kOS/FBEx github.com/go-playground/validator/v10 v10.20.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc= github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= +github.com/go-test/deep v1.0.4 h1:u2CU3YKy9I2pmu9pX0eq50wCgjfGIt539SqR7FbHiho= +github.com/go-test/deep v1.0.4/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA= github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= @@ -270,6 +274,7 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -311,6 +316,9 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hedzr/log v1.6.3 h1:qCdnDUpeQ+E9vmfDKk+IHjA0QipnWNds2mr4hh6iGxA= +github.com/hedzr/log v1.6.3/go.mod h1:goMXeVWLSKZYxNs+10viGe2O1fbzBNnnLpdx0MoCRkA= github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU= github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= @@ -376,8 +384,8 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= -github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= +github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U= github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-tty v0.0.3 h1:5OfyWorkyO7xP52Mq7tB36ajHDG5OHrmBGIS/DtakQI= @@ -446,6 +454,8 @@ github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= +github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= +github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= @@ -472,6 +482,14 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/skeema/knownhosts v1.2.2 h1:Iug2P4fLmDw9f41PB6thxUkNUkJzB5i+1/exaj40L3A= github.com/skeema/knownhosts v1.2.2/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= +github.com/slack-go/slack v0.13.0 h1:7my/pR2ubZJ9912p9FtvALYpbt0cQPAqkRy2jaSI1PQ= +github.com/slack-go/slack v0.13.0/go.mod h1:hlGi5oXA+Gt+yWTPP0plCdRKmjsDxecdHxYQdlMQKOw= +github.com/slack-io/commander v0.0.0-20231120025847-9fd78b4b2d54 h1:aRc+G2mUb697z6bR09Roq6kP08suJulgNo00SGhAsfM= +github.com/slack-io/commander v0.0.0-20231120025847-9fd78b4b2d54/go.mod h1:aHmXZnL/ELKlfMybblXnnCl+IeHQ+gMb++DT7ujIGlA= +github.com/slack-io/proper v0.0.0-20231119200853-f78ba4fc878f h1:wiEJBKJKvMOeE9KtLV7iwtHOsNXDBZloL+FPlkZ6vnA= +github.com/slack-io/proper v0.0.0-20231119200853-f78ba4fc878f/go.mod h1:q+erLGESzGsEP/cJeGoDxfdLKDstT4caj/JvAShLEt4= +github.com/slack-io/slacker v0.1.1 h1:/44qwaM8HxspLVvSEE7ue4LcKkUyYxIOhraaOWTrBMY= +github.com/slack-io/slacker v0.1.1/go.mod h1:0dIY7rxW5j4aSRq+rg79dpg3My012uZdGrzFmewSKUA= github.com/spf13/afero v1.10.0 h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY= github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -615,8 +633,8 @@ golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -627,8 +645,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 h1:yixxcjnhBmY0nkL253HFVIm0JsFHwrHdT3Yh6szTnfY= -golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8/go.mod h1:jj3sYF3dwk5D+ghuXyeI3r5MFf+NT2An6/9dOA95KSI= +golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 h1:kx6Ds3MlpiUHKj7syVnbp57++8WpuKPcR5yjLBjvLEA= +golang.org/x/exp v0.0.0-20240823005443-9b4947da3948/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -655,8 +673,8 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= -golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= +golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -694,8 +712,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -718,8 +736,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -787,15 +805,15 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= +golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -807,13 +825,14 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -868,8 +887,8 @@ golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= -golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -981,6 +1000,7 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/hedzr/errors.v3 v3.1.1/go.mod h1:UwtyepqtGTIAmdZGSc7wxXT5Gfd/BjcfRMhPpxwkJM4= gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= diff --git a/core/metrics/instrumentation/slackertrace/doc.go b/core/metrics/instrumentation/slackertrace/doc.go new file mode 100644 index 0000000000..0def2d90a2 --- /dev/null +++ b/core/metrics/instrumentation/slackertrace/doc.go @@ -0,0 +1,2 @@ +// Package slackertrace provides a Slacker trace exporter for OpenTelemetry. +package slackertrace diff --git a/contrib/opbot/botmd/middleware.go b/core/metrics/instrumentation/slackertrace/otel.go similarity index 73% rename from contrib/opbot/botmd/middleware.go rename to core/metrics/instrumentation/slackertrace/otel.go index 88de5e8809..1a93213538 100644 --- a/contrib/opbot/botmd/middleware.go +++ b/core/metrics/instrumentation/slackertrace/otel.go @@ -1,51 +1,20 @@ -package botmd +package slackertrace import ( "context" - "fmt" "github.com/hedzr/log" "github.com/slack-io/slacker" - "github.com/synapsecns/sanguine/core/metrics" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/metric" - "go.opentelemetry.io/otel/trace" "time" ) const ( - instrumentationName = "github.com/synapsecns/sanguine/contrib/opbot/botmd" + instrumentationName = "github.com/synapsecns/sanguine/core/metrics/instrumentation/slcakertracer" instrumentationVersion = "0.1.0" ) -func (b *Bot) tracingMiddleware() slacker.CommandMiddlewareHandler { - return func(next slacker.CommandHandler) slacker.CommandHandler { - return func(cmdCtx *slacker.CommandContext) { - ctx, span := b.handler.Tracer().Start(cmdCtx.Context(), fmt.Sprintf("command.%s", cmdCtx.Definition().Command), trace.WithAttributes( - attribute.String("user_id", cmdCtx.Event().UserID), - attribute.String("channel_id", retrieveChannelIfExists(cmdCtx.Event())), - )) - - cmdCtx.WithContext(ctx) - - defer func() { - metrics.EndSpan(span) - }() - - next(cmdCtx) - } - } -} - -const unknownChannel = "unknown" - -func retrieveChannelIfExists(event *slacker.MessageEvent) string { - if event != nil && event.Channel != nil { - return event.Channel.ID - } - return unknownChannel -} - // assumes method is only called once. type otelRecorder struct { attemptsCounter metric.Int64UpDownCounter @@ -95,7 +64,8 @@ func (r *otelRecorder) ObserverCommandDuration(ctx context.Context, duration tim r.totalDuration.Record(ctx, int64(duration/time.Millisecond), metric.WithAttributes(attributes...)) } -func (b *Bot) metricsMiddleware() slacker.CommandMiddlewareHandler { +// MetricsMiddleware returns a slacker middleware that records metrics for each command. +func MetricsMiddleware() slacker.CommandMiddlewareHandler { // assumes method is only called once. otr := newOtelRecorder() diff --git a/core/metrics/instrumentation/slackertrace/tracing.go b/core/metrics/instrumentation/slackertrace/tracing.go new file mode 100644 index 0000000000..5df4b45d77 --- /dev/null +++ b/core/metrics/instrumentation/slackertrace/tracing.go @@ -0,0 +1,38 @@ +package slackertrace + +import ( + "fmt" + "github.com/slack-io/slacker" + "github.com/synapsecns/sanguine/core/metrics" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/trace" +) + +// TracingMiddleware is a middleware that creates a new span for each command. +func TracingMiddleware(handler metrics.Handler) slacker.CommandMiddlewareHandler { + return func(next slacker.CommandHandler) slacker.CommandHandler { + return func(cmdCtx *slacker.CommandContext) { + ctx, span := handler.Tracer().Start(cmdCtx.Context(), fmt.Sprintf("command.%s", cmdCtx.Definition().Command), trace.WithAttributes( + attribute.String("user_id", cmdCtx.Event().UserID), + attribute.String("channel_id", retrieveChannelIfExists(cmdCtx.Event())), + )) + + cmdCtx.WithContext(ctx) + + defer func() { + metrics.EndSpan(span) + }() + + next(cmdCtx) + } + } +} + +const unknownChannel = "unknown" + +func retrieveChannelIfExists(event *slacker.MessageEvent) string { + if event != nil && event.Channel != nil { + return event.Channel.ID + } + return unknownChannel +} diff --git a/docs/bridge/CHANGELOG.md b/docs/bridge/CHANGELOG.md index 74f0c06f96..e0a5efccb2 100644 --- a/docs/bridge/CHANGELOG.md +++ b/docs/bridge/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.2.2](https://github.com/synapsecns/sanguine/compare/@synapsecns/bridge-docs@0.2.1...@synapsecns/bridge-docs@0.2.2) (2024-08-22) + +**Note:** Version bump only for package @synapsecns/bridge-docs + + + + + +## [0.2.1](https://github.com/synapsecns/sanguine/compare/@synapsecns/bridge-docs@0.2.0...@synapsecns/bridge-docs@0.2.1) (2024-08-20) + +**Note:** Version bump only for package @synapsecns/bridge-docs + + + + + # [0.2.0](https://github.com/synapsecns/sanguine/compare/@synapsecns/bridge-docs@0.1.6...@synapsecns/bridge-docs@0.2.0) (2024-08-13) diff --git a/docs/bridge/docs/rfq/API/API.md b/docs/bridge/docs/rfq/API/API.md index 63bfd4c607..392f91e1c0 100644 --- a/docs/bridge/docs/rfq/API/API.md +++ b/docs/bridge/docs/rfq/API/API.md @@ -29,6 +29,13 @@ Only Solvers should be writing to the API, end-users need only read from the `/q In accordance with [EIP-191](https://eips.ethereum.org/EIPS/eip-191), the RFQ API requires a signature to be sent with each request. The signature should be generated by the user's wallet and should be a valid signature of the message `rfq-api` with the user's private key. The signature should be sent in the `Authorization` header of the request. We provide a client stub/example implementation in go [here](https://pkg.go.dev/github.com/synapsecns/sanguine/services/rfq@v0.13.3/api/client). +:::note + +The RFQ API expects the signatures to have V values as 0/1 rather than 27/28. The fastest way to fix this is to modify V by subtracting 27 + +::: + + ### API Urls - mainnet: rfq-api.omnirpc.io diff --git a/docs/bridge/docs/rfq/Contracts.md b/docs/bridge/docs/rfq/Contracts.md index 561d7cc49d..a5b0947942 100644 --- a/docs/bridge/docs/rfq/Contracts.md +++ b/docs/bridge/docs/rfq/Contracts.md @@ -8,6 +8,10 @@ The Synapse RFQ contract source code can be found [here](https://github.com/syna | Base | [0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E](https://basescan.org/address/0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E) | | Ethereum | [0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E](https://etherscan.io/address/0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E) | | Optimism | [0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E](https://optimistic.etherscan.io/address/0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E) | +| Scroll | [0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E](https://scrollscan.com/address/0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E) | +| Linea | [0x34F52752975222d5994C206cE08C1d5B329f24dD](https://lineascan.build/address/0x34F52752975222d5994C206cE08C1d5B329f24dD) | +| BNB Chain| [0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E](https://bscscan.com/address/0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E) | +| Blast | [0x34F52752975222d5994C206cE08C1d5B329f24dD](https://blastscan.io/address/0x34F52752975222d5994C206cE08C1d5B329f24dD) | ### On-Chain Architecture & Transaction Flow @@ -16,7 +20,7 @@ The RFQ contract allows users to post bridge requests based on quotes they have 1. **User calls bridge**: The user calls the bridge contract with the quote they have received from the RFQ API and passing in origin, destination and other paramaters as a [BridgeParam](https://vercel-rfq-docs.vercel.app/contracts/interfaces/IFastBridge.sol/interface.IFastBridge.html#bridgeparams). 2. **Bridge emits event**: The bridge contract emits a [`BridgeRequested`](https://vercel-rfq-docs.vercel.app/contracts/interfaces/IFastBridge.sol/interface.IFastBridge.html#bridgerequested) event. 3. **Solver relays request**: The solver relays the request by calling the [`relay`](https://vercel-rfq-docs.vercel.app/contracts/FastBridge.sol/contract.FastBridge.html#relay) function on the RFQ contract. The contract then pulls the tokens from the solvers wallet (or [msg.value](https://ethereum.stackexchange.com/questions/43362/what-is-msg-value) in the case of eth) and sends them to the user filling their order. -4. **Solver Calls Prove**: The solver then calls the [`prove`](https://vercel-rfq-docs.vercel.app/contracts/FastBridge.sol/contract.FastBridge.html#prove) function on the RFQ contract to prove they have filled the order. +4. **Solver Calls Prove**: The solver then calls the [`prove`](https://vercel-rfq-docs.vercel.app/contracts/FastBridge.sol/contract.FastBridge.html#prove) function on the RFQ contract to prove they have filled the order. In the current implementation, the function must be called from the solver address. 5. **User Claims**: If the solver does not call prove within the optimistic window, the user can call the [`claim`](https://vercel-rfq-docs.vercel.app/contracts/FastBridge.sol/contract.FastBridge.html#claim) function to claim their funds back. ### On-Chain Statuses @@ -30,3 +34,18 @@ Like the relayer, each transaction in the RFQ contract has a status. The statuse | Relayer Proved | 2 | The relayer has tried to [`prove`](https://vercel-rfq-docs.vercel.app/contracts/FastBridge.sol/contract.FastBridge.html#prove) the transaction, but cannot claim yet. | | Relayer Claimed | 3 | The relayer has called [`claim`](https://vercel-rfq-docs.vercel.app/contracts/FastBridge.sol/contract.FastBridge.html#claim) and gotten the funds. | | Refunded | 4 | The relayer has not called `claim` within the optimistic period or a dispute has been decided in favor of the user and the users been refunded. | + + +### Dispute Period and Guards + +The RFQ system includes a dispute period and guards to ensure the integrity of bridge transactions. Here's how it works: + +After a relayer submits a proof for a bridge transaction, there's a set period during which the transaction can be disputed. This period allows for detection and correction of any errors or fraudulent activities. Guards are responsible for monitoring bridge transactions and initiating disputes if they detect issues such as incorrect fill amounts and proofs submitted by the wrong relayer. A successful dispute would end up with the relayer losing their claimable funds. + +The current implementation is architectured to enforce honest behavior and also protect honest relayers in cases of blockchain reorgs. + +### Other Functionalities + +**ChainGas** + +`sendChainGas` is a field that is populated by the bridge user, and it's a simple bool flag. If `sendChainGas=true` the amount is specified in the FastBridge contract on the destination chain as `chainGasAmount`. This is currently set to zero in all the contracts, and can thus be ignored by filling orders with either no `sendChainGas` option (or to chains with `chainGasAmount==0`) diff --git a/docs/bridge/docs/rfq/Relayer/Relayer.md b/docs/bridge/docs/rfq/Relayer/Relayer.md index a51cf772b6..a7a59a7cde 100644 --- a/docs/bridge/docs/rfq/Relayer/Relayer.md +++ b/docs/bridge/docs/rfq/Relayer/Relayer.md @@ -2,7 +2,11 @@ sidebar_position: 0 sidebar_label: Relayer --- +:::note +Relayers must be whitelisted in order to fill bridgeRequests. + +::: At a high level, the canonical implementation of the relayer has 3 different responsibilities. @@ -23,13 +27,16 @@ The quoting loop is comparitively simple and updates the api on each route it su ### Rebalancing -The rebalancing loop is more complex and is responsible for ensuring that the relayer has enough liquidity on each chain. Right now only the CCTP rebalancer is supported and works like this: +The rebalancing loop is more complex and is responsible for ensuring that the relayer has enough liquidity on each chain. The CCTP rebalancer is supported and works like this: 1. At `rebalance_interval`, check the `maintenance_balance_pct` of each token on each chain and compare it to the current balance. If the balance is below the `maintenance_balance_pct`, continue 2. Calculate the amount to rebalance by taking the difference between the maintenance balance and the current balance and multiplying it by the `initial_balance_pct`. 3. If the amount to rebalance is greater than the `max_rebalance_amount`, set the amount to rebalance to the `max_rebalance_amount`. If the amount to rebalance is less than the `min_rebalance_amount`, do not rebalance. 4. Repeat after `rebalance_interval` +The implementation for certain native bridges (e.g Scroll) is also supported. It works slightly differently as flows are only supported between Scroll and Mainnet. At a high level, the rebalancer checks inventory on Scroll versus other chains, and if imbalanced, initiates a bridge to mainnet, allowing the CCTP relayer to rebalance funds where needed. + + ### Relaying The relaying loop is the most complex and is responsible for relaying funds on-chain. The relayer listens to events on-chain and status updates in the database to take move transactions through the states. The states are as follows: @@ -104,7 +111,7 @@ The relayer is configured with a yaml file. The following is an example configur screener_api_url: 'http://screener-url' # can be left blank rfq_url: 'http://rfq-api' # url of the rfq api backend. - omnirpc_url: 'http://omnirpc' # url of the omnirpc instance + omnirpc_url: 'http://omnirpc' # url of the omnirpc instance, please reference the Omnirpc section under Services for proper configuration rebalance_interval: 2m # how often to rebalance relayer_api_port: '8081' # api port for the relayer api @@ -190,7 +197,7 @@ The relayer is configured with a yaml file. The following is an example configur - chain_id: 10 synapse_cctp_address: "0x12715a66773BD9C54534a01aBF01d05F6B4Bd35E" token_messenger_address: "0x2B4069517957735bE00ceE0fadAE88a26365528f" - base_omnirpc_url: "http://omnirpc" + base_omnirpc_url: "http://omnirpc" # Make sure this is configured properly unbonded_signer: type: GCP file: /config/signer.txt diff --git a/docs/bridge/package.json b/docs/bridge/package.json index 2867ba10d3..7a87636b08 100644 --- a/docs/bridge/package.json +++ b/docs/bridge/package.json @@ -1,6 +1,6 @@ { "name": "@synapsecns/bridge-docs", - "version": "0.2.0", + "version": "0.2.2", "private": true, "scripts": { "docusaurus": "docusaurus", diff --git a/ethergo/.goreleaser.yml b/ethergo/.goreleaser.yml index 597cd0af9b..168562f3f7 100644 --- a/ethergo/.goreleaser.yml +++ b/ethergo/.goreleaser.yml @@ -29,6 +29,30 @@ builds: - linux goarch: - amd64 + - id: usdclistener-example + binary: usdclistener-example + gcflags: + - all=-dwarflocationlists=true + ldflags: + # We need to build a static binary because we are building in a glibc based system and running in a musl container + - -extldflags '-static' -X github.com/synapsecns/sanguine/core/config.DefaultVersion={{.Version}} -X github.com/synapsecns/sanguine/core/config.DefaultCommit={{.Commit}} -X github.com/synapsecns/sanguine/core/config.DefaultDate={{ .CommitDate }} + # required workaround for https://github.com/Shopify/sarama/issues/2206 + # See: https://github.com/golang/go/issues/35067#issuecomment-544805311 because we're statically compiling, + # without forcing netgo, we use the cgo resolver which will not work for .local (a canonical tld in kubernetes) + # the other way to resolve this would be to modify the nsswitch.conf in the container, but that's a bit less clean. + # osusergo was included as a recommendation here: https://github.com/kubernetes/kubernetes/pull/114225#issuecomment-1348920040 + tags: + - netgo + - osusergo + env: + - CC=gcc + - CXX=g++ + main: examples/usdclistener/main.go + goos: + - linux + goarch: + - amd64 + dockers: # Docker AMD64 diff --git a/ethergo/examples/usdclistener/main.go b/ethergo/examples/usdclistener/main.go new file mode 100644 index 0000000000..338a5105ec --- /dev/null +++ b/ethergo/examples/usdclistener/main.go @@ -0,0 +1,86 @@ +package main + +import ( + "context" + "errors" + "fmt" + "github.com/synapsecns/sanguine/ethergo/client" + listenerDB "github.com/synapsecns/sanguine/ethergo/listener/db" + "log" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/synapsecns/sanguine/core/metrics" + "github.com/synapsecns/sanguine/ethergo/listener" + "gorm.io/driver/sqlite" + "gorm.io/gorm" +) + +const ( + ethereumNodeURL = "https://eth.llamarpc.com" // Replace with your Ethereum node URL + contractAddress = "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" // Replace with the contract address you want to listen to + dbPath = ":memory:" + initialBlock = 0 // Replace with the block number you want to start listening from +) + +func main() { + db, err := gorm.Open(sqlite.Open(dbPath), &gorm.Config{}) + if err != nil { + log.Fatalf("Failed to connect to database: %v", err) + } + + err = db.AutoMigrate(listenerDB.GetAllModels()...) + if err != nil { + log.Fatalf("Failed to migrate database: %v", err) + } + + // Create a simple metrics handler (you may want to implement a proper one) + metricsHandler := metrics.NewNullHandler() + + store := listenerDB.NewChainListenerStore(db, metricsHandler) + + _, err = store.LatestBlockForChain(context.Background(), 1) + if err != nil { + if !errors.Is(err, listenerDB.ErrNoLatestBlockForChainID) { + log.Fatalf("Failed to get latest block: %v", err) + } + + // pick a reasonable start block, will default to 0. + err = store.PutLatestBlock(context.Background(), 1, 20612563) + if err != nil { + log.Fatalf("Failed to put latest block): %v", err) + } + } + + ethClient, err := client.DialBackend(context.Background(), ethereumNodeURL, metricsHandler) + if err != nil { + log.Fatalf("Failed to connect to Ethereum node: %v", err) + } + + contractAddr := common.HexToAddress(contractAddress) + + chainListener, err := listener.NewChainListener( + ethClient, + store, + contractAddr, + uint64(initialBlock), + metricsHandler, + ) + if err != nil { + log.Fatalf("Failed to create chain listener: %v", err) + } + + ctx := context.Background() + + fmt.Println("Starting listener...") + err = chainListener.Listen(ctx, handleLog) + if err != nil { + log.Fatalf("Listener error: %v", err) + } +} + +func handleLog(_ context.Context, log types.Log) error { + fmt.Printf("New log: BlockNumber=%d, TxHash=%s\n", log.BlockNumber, log.TxHash.Hex()) + // Here you can process the log as needed + return nil +} diff --git a/ethergo/go.mod b/ethergo/go.mod index 99fca7d280..34dbf11722 100644 --- a/ethergo/go.mod +++ b/ethergo/go.mod @@ -62,8 +62,8 @@ require ( go.opentelemetry.io/otel/trace v1.28.0 go.uber.org/atomic v1.11.0 go.uber.org/zap v1.27.0 - golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 - golang.org/x/sync v0.7.0 + golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 + golang.org/x/sync v0.8.0 golang.org/x/time v0.5.0 google.golang.org/api v0.183.0 google.golang.org/protobuf v1.34.2 @@ -85,7 +85,6 @@ require ( cloud.google.com/go/longrunning v0.5.7 // indirect dario.cat/mergo v1.0.0 // indirect github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect - github.com/BurntSushi/toml v1.4.0 // indirect github.com/DataDog/zstd v1.5.2 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect @@ -207,7 +206,7 @@ require ( github.com/leodido/go-urn v1.4.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.15 // indirect + github.com/mattn/go-runewidth v0.0.16 // indirect github.com/mattn/go-sqlite3 v2.0.3+incompatible // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect @@ -276,13 +275,13 @@ require ( go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/arch v0.8.0 // indirect - golang.org/x/crypto v0.24.0 // indirect - golang.org/x/mod v0.19.0 // indirect - golang.org/x/net v0.26.0 // indirect + golang.org/x/crypto v0.26.0 // indirect + golang.org/x/mod v0.20.0 // indirect + golang.org/x/net v0.28.0 // indirect golang.org/x/oauth2 v0.21.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/text v0.16.0 // indirect - golang.org/x/tools v0.22.0 // indirect + golang.org/x/sys v0.24.0 // indirect + golang.org/x/text v0.17.0 // indirect + golang.org/x/tools v0.24.0 // indirect google.golang.org/genproto v0.0.0-20240528184218-531527333157 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect diff --git a/ethergo/go.sum b/ethergo/go.sum index c28093c51b..67e60eeaed 100644 --- a/ethergo/go.sum +++ b/ethergo/go.sum @@ -771,8 +771,8 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= -github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= +github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U= github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= @@ -1184,8 +1184,8 @@ golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1199,8 +1199,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 h1:yixxcjnhBmY0nkL253HFVIm0JsFHwrHdT3Yh6szTnfY= -golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8/go.mod h1:jj3sYF3dwk5D+ghuXyeI3r5MFf+NT2An6/9dOA95KSI= +golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 h1:kx6Ds3MlpiUHKj7syVnbp57++8WpuKPcR5yjLBjvLEA= +golang.org/x/exp v0.0.0-20240823005443-9b4947da3948/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -1229,8 +1229,8 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= -golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= +golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1282,8 +1282,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1308,8 +1308,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1396,16 +1396,16 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= +golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1418,8 +1418,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1491,8 +1491,8 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= -golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/ethergo/listener/README.md b/ethergo/listener/README.md new file mode 100644 index 0000000000..ea93828923 --- /dev/null +++ b/ethergo/listener/README.md @@ -0,0 +1,91 @@ +# Listener + +![logo.png](logo.png) + + +```mermaid +sequenceDiagram + participant User + participant EthereumNode + participant SQLiteDB + participant Listener + + User->>Listener: Start Listener + Listener->>SQLiteDB: Connect and Migrate Models + Listener->>EthereumNode: Connect to Ethereum Node + Listener->>EthereumNode: Retrieve Latest Block + Listener->>Listener: Listen for Logs + Listener->>User: Process Log +``` + + +# Using Listener DB + +There is a simple example [here](../examples/usdclistener). + + +## Migrating to ListenerDB + +This guide outlines the steps to migrate your service to use the new ListenerDB interface. Follow these steps for each service that needs to be updated. + +## 1. Remove Deprecated Methods + +Delete any deprecated methods that are no longer needed with ListenerDB. + +## 2. Update Interface Definitions +Add the `ListenerDB` interface to your `Service` interface: + +```go +type Service interface { + Reader + Writer + SubmitterDB() submitterDB.Service + listenerDB.ChainListenerDB +} +``` + +## 3. Update GetAllModels Function + +Modify the `GetAllModels` function to include ListenerDB models: + +```go +func GetAllModels() (allModels []interface{}) { + allModels = append(txdb.GetAllModels(), &YourModel{}) + allModels = append(allModels, listenerDB.GetAllModels()...) + return allModels +} +``` + +## 4. Implement ListenerDB in Store + +Update your `Store` struct and `NewStore` function: + +```go +type Store struct { + db *gorm.DB + submitterStore submitterDB.Service + listenerDB.ChainListenerDB +} + +func NewStore(db *gorm.DB, metrics metrics.Handler) *Store { + txDB := txdb.NewTXStore(db, metrics) + listener := listenerDB.NewChainListenerStore(db, metrics) + + return &Store{ + db: db, + submitterStore: txDB, + ChainListenerDB: listener, + } +} +``` + + +## 6. Refactor Usage + +Replace all calls to the removed methods with the appropriate methods from the `ChainListenerDB` interface. + +## 7. Testing + +After making these changes, thoroughly test your service to ensure all functionality works as expected with the new ListenerDB implementation. + +By following these steps, you should successfully migrate your service to use the new ListenerDB interface. Remember to replace `YourModel` with the actual model name in your implementation. If you encounter any issues or need further clarification, please refer to the ListenerDB documentation or consult with your team. diff --git a/ethergo/listener/db/service.go b/ethergo/listener/db/service.go index fb2e7d922c..cc014fea36 100644 --- a/ethergo/listener/db/service.go +++ b/ethergo/listener/db/service.go @@ -2,17 +2,20 @@ package db import ( "context" - "gorm.io/gorm" "time" + + "gorm.io/gorm" ) // ChainListenerDB is the interface for the chain listener database. type ChainListenerDB interface { - // PutLatestBlock upsers the latest block on a given chain id to be new height. + // PutLatestBlock upserts the latest block on a given chain id to be new height. PutLatestBlock(ctx context.Context, chainID, height uint64) error // LatestBlockForChain gets the latest block for a given chain id. // will return ErrNoLatestBlockForChainID if no block exists for the chain. LatestBlockForChain(ctx context.Context, chainID uint64) (uint64, error) + // SetListenerName sets the listener name. + SetListenerName(name string) } // LastIndexed is used to make sure we haven't missed any events while offline. @@ -28,9 +31,11 @@ type LastIndexed struct { // DeletedAt time DeletedAt gorm.DeletedAt `gorm:"index"` // ChainID is the chain id of the chain we're watching blocks on. This is our primary index. - ChainID uint64 `gorm:"column:chain_id;primaryKey;autoIncrement:false"` + ChainID uint64 `gorm:"column:chain_id;index:idx_chain_name,unique"` // BlockHeight is the highest height we've seen on the chain BlockNumber int `gorm:"block_number"` + // ListenerName is the name of the listener that is tracking this chain + ListenerName string `gorm:"column:listener_name;index:idx_chain_name,unique"` } // GetAllModels gets all models to migrate diff --git a/ethergo/listener/db/store.go b/ethergo/listener/db/store.go index 396d2177e7..3f57d368d3 100644 --- a/ethergo/listener/db/store.go +++ b/ethergo/listener/db/store.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "github.com/synapsecns/sanguine/core/dbcommon" "github.com/synapsecns/sanguine/core/metrics" "gorm.io/gorm" @@ -20,44 +21,53 @@ func NewChainListenerStore(db *gorm.DB, metrics metrics.Handler) *Store { // Store is the sqlite store. It extends the base store for sqlite specific queries. type Store struct { - db *gorm.DB - metrics metrics.Handler + db *gorm.DB + metrics metrics.Handler + listenerName string } // PutLatestBlock upserts the latest block into the database. -func (s Store) PutLatestBlock(ctx context.Context, chainID, height uint64) error { +func (s *Store) PutLatestBlock(ctx context.Context, chainID, height uint64) error { tx := s.db.WithContext(ctx).Clauses(clause.OnConflict{ - Columns: []clause.Column{{Name: chainIDFieldName}}, - DoUpdates: clause.AssignmentColumns([]string{chainIDFieldName, blockNumberFieldName}), + Columns: []clause.Column{{Name: chainIDFieldName}, {Name: listenerNameFieldName}}, + DoUpdates: clause.AssignmentColumns([]string{chainIDFieldName, blockNumberFieldName, listenerNameFieldName}), }).Create(&LastIndexed{ - ChainID: chainID, - BlockNumber: int(height), + ChainID: chainID, + BlockNumber: int(height), + ListenerName: s.listenerName, }) - if tx.Error != nil { - return fmt.Errorf("could not block updated: %w", tx.Error) + return fmt.Errorf("could not update latest block: %w", tx.Error) } return nil } // LatestBlockForChain gets the latest block for a chain. -func (s Store) LatestBlockForChain(ctx context.Context, chainID uint64) (uint64, error) { - blockWatchModel := LastIndexed{ChainID: chainID} - err := s.db.WithContext(ctx).First(&blockWatchModel).Error - if err != nil { - if errors.Is(err, gorm.ErrRecordNotFound) { +func (s *Store) LatestBlockForChain(ctx context.Context, chainID uint64) (uint64, error) { + var lastIndexed LastIndexed + tx := s.db.WithContext(ctx). + Where(fmt.Sprintf("%s = ?", chainIDFieldName), chainID). + Where(fmt.Sprintf("%s = ?", listenerNameFieldName), s.listenerName). + First(&lastIndexed) + if tx.Error != nil { + if errors.Is(tx.Error, gorm.ErrRecordNotFound) { return 0, ErrNoLatestBlockForChainID } - return 0, fmt.Errorf("could not fetch latest block: %w", err) + return 0, fmt.Errorf("could not fetch latest block: %w", tx.Error) } + return uint64(lastIndexed.BlockNumber), nil +} - return uint64(blockWatchModel.BlockNumber), nil +// SetListenerName sets the listener name. +func (s *Store) SetListenerName(name string) { + s.listenerName = name } func init() { namer := dbcommon.NewNamer(GetAllModels()) chainIDFieldName = namer.GetConsistentName("ChainID") blockNumberFieldName = namer.GetConsistentName("BlockNumber") + listenerNameFieldName = namer.GetConsistentName("ListenerName") } var ( @@ -65,6 +75,8 @@ var ( chainIDFieldName string // blockNumberFieldName is the name of the block number field. blockNumberFieldName string + // listenerNameFieldName is the name of the listener name field. + listenerNameFieldName string ) // ErrNoLatestBlockForChainID is returned when no block exists for the chain. diff --git a/ethergo/listener/listener.go b/ethergo/listener/listener.go index 73faac9987..d53bf08e05 100644 --- a/ethergo/listener/listener.go +++ b/ethergo/listener/listener.go @@ -53,6 +53,7 @@ type chainListener struct { blockWait uint64 // otelRecorder is the recorder for the otel metrics. otelRecorder iOtelRecorder + name string } var ( @@ -94,7 +95,7 @@ func (c *chainListener) Listen(ctx context.Context, handler HandleLog) (err erro } if c.otelRecorder == nil { - c.otelRecorder, err = newOtelRecorder(c.handler, int(c.chainID)) + c.otelRecorder, err = newOtelRecorder(c.handler, int(c.chainID), c.name) if err != nil { return fmt.Errorf("could not create otel recorder: %w", err) } diff --git a/ethergo/listener/logo.png b/ethergo/listener/logo.png new file mode 100644 index 0000000000..ecd0076941 Binary files /dev/null and b/ethergo/listener/logo.png differ diff --git a/ethergo/listener/options.go b/ethergo/listener/options.go index 8511d9eb0c..3cd314cbe8 100644 --- a/ethergo/listener/options.go +++ b/ethergo/listener/options.go @@ -50,3 +50,11 @@ func WithBlockWait(wait uint64) Option { c.blockWait = wait } } + +// WithName sets the listener name. +func WithName(name string) Option { + return func(c *chainListener) { + c.name = name + c.store.SetListenerName(name) + } +} diff --git a/ethergo/listener/otel.go b/ethergo/listener/otel.go index d308b466cd..b528624fcd 100644 --- a/ethergo/listener/otel.go +++ b/ethergo/listener/otel.go @@ -37,15 +37,18 @@ type otelRecorder struct { lastBlockFetchTime *time.Time // chainID is the chain ID for the listener. chainID int + // listenerName is the name of the listener. + listenerName string } -func newOtelRecorder(meterHandler metrics.Handler, chainID int) (_ iOtelRecorder, err error) { +func newOtelRecorder(meterHandler metrics.Handler, chainID int, name string) (_ iOtelRecorder, err error) { or := otelRecorder{ metrics: meterHandler, meter: meterHandler.Meter(meterName), lastBlock: nil, lastBlockFetchTime: nil, chainID: chainID, + listenerName: name, } or.lastBlockGauge, err = or.meter.Int64ObservableGauge("last_block") @@ -78,6 +81,7 @@ func (o *otelRecorder) recordLastBlock(_ context.Context, observer metric.Observ opts := metric.WithAttributes( attribute.Int(metrics.ChainID, o.chainID), + attribute.String("listener_name", o.listenerName), ) observer.ObserveInt64(o.lastBlockGauge, int64(*o.lastBlock), opts) @@ -92,6 +96,7 @@ func (o *otelRecorder) recordLastFetchedBlockAge(_ context.Context, observer met age := time.Since(*o.lastBlockFetchTime).Seconds() opts := metric.WithAttributes( attribute.Int(metrics.ChainID, o.chainID), + attribute.String("listener_name", o.listenerName), ) observer.ObserveFloat64(o.lastFetchedBlockAgeGauge, age, opts) diff --git a/ethergo/listener/suite_test.go b/ethergo/listener/suite_test.go index 2245941e11..367791f937 100644 --- a/ethergo/listener/suite_test.go +++ b/ethergo/listener/suite_test.go @@ -3,6 +3,11 @@ package listener_test import ( "context" "fmt" + "math/big" + "os" + "testing" + "time" + "github.com/brianvoe/gofakeit/v6" "github.com/ipfs/go-log" common_base "github.com/synapsecns/sanguine/core/dbcommon" @@ -12,10 +17,6 @@ import ( db2 "github.com/synapsecns/sanguine/ethergo/listener/db" "gorm.io/gorm" "gorm.io/gorm/schema" - "math/big" - "os" - "testing" - "time" "github.com/Flaque/filet" "github.com/ethereum/go-ethereum/accounts/abi/bind" diff --git a/go.work.sum b/go.work.sum index 7f0cb6dc44..f6c15a1527 100644 --- a/go.work.sum +++ b/go.work.sum @@ -1796,6 +1796,8 @@ github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1 h1:cKr6St+CtC3/dl/rEBJvlk7A/ github.com/aws/aws-sdk-go-v2/service/route53 v1.30.2 h1:/RPQNjh1sDIezpXaFIkZb7MlXnSyAqjVdAwcJuGYTqg= github.com/aws/aws-sdk-go-v2/service/route53 v1.30.2/go.mod h1:TQZBt/WaQy+zTHoW++rnl8JBrmZ0VO6EUbVua1+foCA= github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= +github.com/aymanbagabas/go-udiff v0.2.0 h1:TK0fH4MteXUDspT88n8CKzvK0X9O2xu9yQjWpi6yML8= +github.com/aymanbagabas/go-udiff v0.2.0/go.mod h1:RE4Ex0qsGkTAJoQdQQCA0uG+nAzJO/pI/QwceO5fgrA= github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible h1:Ppm0npCCsmuR9oQaBtRuZcmILVE74aXE+AmrJj8L2ns= @@ -1864,6 +1866,8 @@ github.com/charmbracelet/ssh v0.0.0-20240515141028-546b2ee33a4d h1:u9HPsRc4wlU2m github.com/charmbracelet/ssh v0.0.0-20240515141028-546b2ee33a4d/go.mod h1:8/Ve8iGRRIGFM1kepYfRF2pEOF5Y3TEZYoJaA54228U= github.com/charmbracelet/x/errors v0.0.0-20240524151031-ff83003bf67a h1:0lYEktGULal6+O5l2gmEf6ZIEujR9OQqHF4K6V+rGYE= github.com/charmbracelet/x/errors v0.0.0-20240524151031-ff83003bf67a/go.mod h1:2P0UgXMEa6TsToMSuFqKFQR+fZTO9CNGUNokkPatT/0= +github.com/charmbracelet/x/exp/golden v0.0.0-20240815200342-61de596daa2b h1:MnAMdlwSltxJyULnrYbkZpp4k58Co7Tah3ciKhSNo0Q= +github.com/charmbracelet/x/exp/golden v0.0.0-20240815200342-61de596daa2b/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U= github.com/chavacava/garif v0.0.0-20210405163807-87a70f3d418b h1:StHNkfM8nXnNQnk5/0uYYhIqvvENd14hoHPnZsakTNo= github.com/checkpoint-restore/go-criu/v4 v4.1.0 h1:WW2B2uxx9KWF6bGlHqhm8Okiafwwx7Y2kcpn8lCpjgo= github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= @@ -3279,6 +3283,8 @@ github.com/safchain/ethtool v0.2.0 h1:dILxMBqDnQfX192cCAPjZr9v2IgVXeElHPy435Z/Id github.com/safchain/ethtool v0.2.0/go.mod h1:WkKB1DnNtvsMlDmQ50sgwowDJV/hGbJSOvJoEXs1AJQ= github.com/sahilm/fuzzy v0.1.1-0.20230530133925-c48e322e2a8f h1:MvTmaQdww/z0Q4wrYjDSCcZ78NoftLQyHBSLW/Cx79Y= github.com/sahilm/fuzzy v0.1.1-0.20230530133925-c48e322e2a8f/go.mod h1:VFvziUEIMCrT6A6tw2RFIXPXXmzXbOsSHF0DOI8ZK9Y= +github.com/sahilm/fuzzy v0.1.1 h1:ceu5RHF8DGgoi+/dR5PsECjCDH1BE3Fnmpo7aVXOdRA= +github.com/sahilm/fuzzy v0.1.1/go.mod h1:VFvziUEIMCrT6A6tw2RFIXPXXmzXbOsSHF0DOI8ZK9Y= github.com/samber/lo v1.36.0 h1:4LaOxH1mHnbDGhTVE0i1z8v/lWaQW8AIfOD3HU4mSaw= github.com/samber/lo v1.36.0/go.mod h1:HLeWcJRRyLKp3+/XBJvOrerCQn9mhdKMHyd7IRlgeQ8= github.com/samber/lo v1.39.0 h1:4gTz1wUhNYLhFSKl6O+8peW0v2F4BCY034GRpU9WnuA= @@ -3311,10 +3317,6 @@ github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFt github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= -github.com/shomali11/commander v0.0.0-20230730023802-0b64f620037d h1:IImd1gV+EdlKWWi8RoHSaccjLQtSi4tJiFOjq6mM+ZQ= -github.com/shomali11/commander v0.0.0-20230730023802-0b64f620037d/go.mod h1:bYyJw/Aj9fK+qoFmRbPJeWsDgq7WGO8f/Qof95qPug4= -github.com/shomali11/proper v0.0.0-20190608032528-6e70a05688e7 h1:wAyBXFZOcLkbaoDlDbMpTCw9xy3yP2YJDMRrbTVuVKU= -github.com/shomali11/proper v0.0.0-20190608032528-6e70a05688e7/go.mod h1:cg2VM85Y+0BcVSICzB+OafOlTcJ9QPbtF4qtuhuR/GA= github.com/shurcooL/component v0.0.0-20170202220835-f88ec8f54cc4 h1:Fth6mevc5rX7glNLpbAMJnqKlfIkcTjZCSHEeqvKbcI= github.com/shurcooL/events v0.0.0-20181021180414-410e4ca65f48 h1:vabduItPAIz9px5iryD5peyx7O3Ya8TBThapgXim98o= github.com/shurcooL/github_flavored_markdown v0.0.0-20181002035957-2122de532470 h1:qb9IthCFBmROJ6YBS31BEMeSYjOscSiG+EO+JVNTz64= @@ -3348,6 +3350,8 @@ github.com/shurcooL/webdavfs v0.0.0-20170829043945-18c3829fa133 h1:JtcyT0rk/9PKO github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/slack-go/slack v0.12.2 h1:x3OppyMyGIbbiyFhsBmpf9pwkUzMhthJMRNmNlA4LaQ= github.com/slack-go/slack v0.12.2/go.mod h1:hlGi5oXA+Gt+yWTPP0plCdRKmjsDxecdHxYQdlMQKOw= +github.com/slack-io/slacker v0.1.1 h1:/44qwaM8HxspLVvSEE7ue4LcKkUyYxIOhraaOWTrBMY= +github.com/slack-io/slacker v0.1.1/go.mod h1:0dIY7rxW5j4aSRq+rg79dpg3My012uZdGrzFmewSKUA= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/sonatard/noctx v0.0.1 h1:VC1Qhl6Oxx9vvWo3UDgrGXYCeKCe3Wbw7qAWL6FrmTY= @@ -3680,6 +3684,8 @@ golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3/go.mod h1:NOZ3BPKG0ec/BKJQgnvsSFpcKLM5xXVWnvZS97DWHgE= golang.org/x/exp v0.0.0-20221205204356-47842c84f3db/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= golang.org/x/exp v0.0.0-20230206171751-46f607a40771/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= @@ -3687,6 +3693,8 @@ golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod h1:CxIveKay+FTh1D0yPZ golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/exp v0.0.0-20240604190554-fc45aab8b7f8/go.mod h1:jj3sYF3dwk5D+ghuXyeI3r5MFf+NT2An6/9dOA95KSI= +golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 h1:kx6Ds3MlpiUHKj7syVnbp57++8WpuKPcR5yjLBjvLEA= +golang.org/x/exp v0.0.0-20240823005443-9b4947da3948/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -3706,6 +3714,8 @@ golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= +golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= @@ -3727,6 +3737,8 @@ golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= @@ -3773,6 +3785,7 @@ golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240208230135-b75ee8823808 h1:+Kc94D8UVEVxJnLXp/+FMfqQARZtWHfVrcRtcG8aT3g= golang.org/x/telemetry v0.0.0-20240208230135-b75ee8823808/go.mod h1:KG1lNk5ZFNssSZLrpVb4sMXKMpGwGXOxSG3rnu2gZQQ= golang.org/x/telemetry v0.0.0-20240521205824-bda55230c457 h1:zf5N6UOrA487eEFacMePxjXAJctxKmyjKUsjA11Uzuk= @@ -3784,11 +3797,15 @@ golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= +golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= +golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220922220347-f3bd1da661af/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -3804,6 +3821,8 @@ golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0 golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df h1:5Pf6pFKu98ODmgnpvkJ3kFUOQGGLIzLIkbzUHp47618= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= diff --git a/packages/explorer-ui/CHANGELOG.md b/packages/explorer-ui/CHANGELOG.md index 9f7fc96608..f5f856aacc 100644 --- a/packages/explorer-ui/CHANGELOG.md +++ b/packages/explorer-ui/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.3.1](https://github.com/synapsecns/sanguine/compare/@synapsecns/explorer-ui@0.3.0...@synapsecns/explorer-ui@0.3.1) (2024-08-27) + +**Note:** Version bump only for package @synapsecns/explorer-ui + + + + + # [0.3.0](https://github.com/synapsecns/sanguine/compare/@synapsecns/explorer-ui@0.2.0...@synapsecns/explorer-ui@0.3.0) (2024-07-30) diff --git a/packages/explorer-ui/package.json b/packages/explorer-ui/package.json index 6f11c9898c..94518d6b01 100644 --- a/packages/explorer-ui/package.json +++ b/packages/explorer-ui/package.json @@ -1,6 +1,6 @@ { "name": "@synapsecns/explorer-ui", - "version": "0.3.0", + "version": "0.3.1", "private": true, "engines": { "node": ">=18.17.0" diff --git a/packages/explorer-ui/pages/tx/[kappa].tsx b/packages/explorer-ui/pages/tx/[kappa].tsx index bb93e6d3c9..05ac17ca7e 100644 --- a/packages/explorer-ui/pages/tx/[kappa].tsx +++ b/packages/explorer-ui/pages/tx/[kappa].tsx @@ -37,12 +37,14 @@ export const BridgeTransaction = ({ queryResult }) => { const transaction = queryResult.bridgeTransactions[0] const { pending, fromInfo, toInfo } = transaction - const getTimeDifference = (start, end) => { - const diff = end - start - if (0 >= diff) { - return '1' + // Get time taken to complete tx w/ appropriate units. + const getTimeElapsedStr = (start, end) => { + const diff = end - start; + if (diff <= 0) { + return '1 second'; } - return diff.toString() + return diff === 1 ? '1 second' : `${diff} seconds`; + } let content @@ -105,8 +107,7 @@ export const BridgeTransaction = ({ queryResult }) => {

Elapsed

{toInfo - ? getTimeDifference(fromInfo.time, toInfo.time) + - ' seconds' + ? getTimeElapsedStr(fromInfo.time, toInfo.time) : '--'}{' '}

diff --git a/packages/rest-api/CHANGELOG.md b/packages/rest-api/CHANGELOG.md index 7b512bddf2..ae10991c52 100644 --- a/packages/rest-api/CHANGELOG.md +++ b/packages/rest-api/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.71](https://github.com/synapsecns/sanguine/compare/@synapsecns/rest-api@1.0.70...@synapsecns/rest-api@1.0.71) (2024-08-29) + +**Note:** Version bump only for package @synapsecns/rest-api + + + + + +## [1.0.70](https://github.com/synapsecns/sanguine/compare/@synapsecns/rest-api@1.0.69...@synapsecns/rest-api@1.0.70) (2024-08-26) + +**Note:** Version bump only for package @synapsecns/rest-api + + + + + ## [1.0.69](https://github.com/synapsecns/sanguine/compare/@synapsecns/rest-api@1.0.68...@synapsecns/rest-api@1.0.69) (2024-08-05) **Note:** Version bump only for package @synapsecns/rest-api diff --git a/packages/rest-api/package.json b/packages/rest-api/package.json index 2ce04de714..5ad94e86b3 100644 --- a/packages/rest-api/package.json +++ b/packages/rest-api/package.json @@ -1,37 +1,36 @@ { "name": "@synapsecns/rest-api", - "version": "1.0.69", + "version": "1.0.71", "private": "true", "engines": { "node": ">=18.17.0" }, "scripts": { - "test": "tsdx test", - "start": "node ./dist/app.js", - "dev": "yarn add @synapsecns/sdk-router && concurrently \"npx tsc --watch\" \"nodemon -q dist/app.js\"", - "test:coverage": "echo 'No tests defined.'", - "lint:fix": "eslint src/**.ts --fix", + "build": "tsc", + "start": "node dist/app.js", + "lint:fix": "eslint src/**/*.ts --fix", "lint:check": "eslint . --max-warnings=0", "ci:lint": "npm run lint:check", - "build:go": " ", - "build:slither": " ", - "build": "echo 'please run build api'", - "build:api": "yarn add @synapsecns/sdk-router && tsc", + "test": "tsdx test", + "test:coverage": "echo 'No tests defined.'", "postinstall": "npm run build" }, "dependencies": { "@ethersproject/bignumber": "^5.7.0", "@ethersproject/providers": "^5.7.2", "@ethersproject/units": "5.7.0", - "@synapsecns/sdk-router": "^0.10.0", + "@synapsecns/sdk-router": "^0.11.0", "bignumber": "^1.1.0", "ethers": "5.7.2", "express": "^4.18.2", + "lodash": "^4.17.21", "supertest": "^6.3.3" }, "description": "A node.js project exposing a rest api for synapse sdk quotes", "devDependencies": { + "@types/supertest": "^6.0.2", "concurrently": "^8.2.0", + "lodash": "^4.17.21", "nodemon": "^3.0.1", "typescript": "^4.8.3" } diff --git a/packages/rest-api/src/app.test.ts b/packages/rest-api/src/app.test.ts deleted file mode 100644 index bcf3df7cb7..0000000000 --- a/packages/rest-api/src/app.test.ts +++ /dev/null @@ -1,38 +0,0 @@ -import request from 'supertest' - -import { server } from './app' - -describe('Server Endpoints', () => { - describe('/swap endpoint', () => { - it('should respond with Invalid Params for invalid request', async () => { - const res = await request(server).get('/swap') - expect(res.statusCode).toEqual(200) - expect(res.text).toContain('

Invalid Params

') - }) - - // Add more tests to check valid swap - // it('should respond with swap quote for valid request', async () => { - // const res = await request(app).get('/swap?...'); - // expect(res.statusCode).toEqual(200); - // // expect... - // }); - }) - - describe('/bridge endpoint', () => { - it('should respond with Invalid Request for invalid request', async () => { - const res = await request(server).get('/bridge') - expect(res.statusCode).toEqual(200) - expect(res.text).toContain('

Invalid Request

') - }) - - // Add more tests to check valid bridge - // it('should respond with bridge quote for valid request', async () => { - // const res = await request(app).get('/bridge?...'); - // expect(res.statusCode).toEqual(200); - // // expect... - // }); - }) - afterAll((done) => { - server.close(done) - }) -}) diff --git a/packages/rest-api/src/app.ts b/packages/rest-api/src/app.ts index b22ab040c7..104db349ff 100644 --- a/packages/rest-api/src/app.ts +++ b/packages/rest-api/src/app.ts @@ -2,52 +2,19 @@ import { JsonRpcProvider } from '@ethersproject/providers' import { SynapseSDK } from '@synapsecns/sdk-router' import { BigNumber } from '@ethersproject/bignumber' import { formatUnits, parseUnits } from '@ethersproject/units' -import * as express from 'express' +import express from 'express' -import * as tokensList from './config/bridgeable' -import * as chainsData from './config/chains.json' -import { BRIDGE_MAP } from './config/bridgeMap' +import * as tokensList from './constants/bridgeable' +import { CHAINS_ARRAY } from './constants/chains' +import { Chain } from './types' +import { BRIDGE_MAP } from './constants/bridgeMap' -// eslint-disable-next-line @typescript-eslint/no-unused-vars -interface Token { - addresses: { - [key: string]: string - } - decimals: number | { [key: string]: number } - symbol: string - name: string - swapableType: string - color: string - visibilityRank: number - priorityRank: number - routeSymbol: string - swapableOn?: number[] - wrapperAddresses?: { - [key: string]: string - } - isNative?: boolean - docUrl?: string -} -// interface Tokens { -// [key: string]: Token -// } - -// const tokens: Tokens = tokensList as any - -interface Chains { - id: number - name: string - rpc: string -} - -const chains: Chains[] = chainsData as any -// eslint-disable-next-line prefer-arrow/prefer-arrow-functions -function findTokenInfo(chain: string, tokenSymbol: string) { +const chains: Chain[] = CHAINS_ARRAY +const findTokenInfo = (chain: string, tokenSymbol: string) => { const chainData = BRIDGE_MAP[chain] if (!chainData) { return null } - for (const tokenAddress in chainData) { if (chainData[tokenAddress].symbol === tokenSymbol) { return { @@ -62,24 +29,18 @@ function findTokenInfo(chain: string, tokenSymbol: string) { const tokenHtml = Object.values(tokensList) .map((token: any) => { - return ( - 'Token: ' + - token.symbol + - '
' + - Object.keys(token.addresses) - .map((chainId) => { - const tokenAddress = token.addresses[chainId] - return ( - '
  • Chain Id: ' + - String(chainId) + - ', Address: ' + - String(tokenAddress) + - '
  • ' - ) - }) - .join('') + - '
    ' - ) + const chainList = Object.entries(token.addresses) + .map( + ([chainId, tokenAddress]) => + `
  • Chain Id: ${chainId}, Address: ${tokenAddress}
  • ` + ) + .join('') + + return ` + Token: ${token.symbol}
    + ${chainList} +
    + ` }) .join('') @@ -88,7 +49,7 @@ const providers = [] const chainIds = [] for (const chain of chains) { - providers.push(new JsonRpcProvider(chain.rpc)) + providers.push(new JsonRpcProvider(chain.rpcUrls.primary)) chainIds.push(chain.id) } // Define the sdk @@ -106,12 +67,7 @@ app.get('/', (_req, res) => {

    Available Chains

    Available Tokens (symbols to use)

    ${tokenHtml}` @@ -129,7 +85,7 @@ app.get('/swap', async (req, res) => { const query = req.query // Chain - const chainId = query.chain + const chainId = String(query.chain) // Symbols const fromTokenSymbol = String(query.fromToken) @@ -218,8 +174,8 @@ app.get('/bridge', async (req, res) => { const query = req.query // Chains - const fromChain = query.fromChain - const toChain = query.toChain + const fromChain = String(query.fromChain) + const toChain = String(query.toChain) // Symbols const fromTokenSymbol = String(query.fromToken) @@ -278,16 +234,17 @@ app.get('/bridge', async (req, res) => { BigNumber.from(amount) ) .then((resp) => { - const firstQuote = resp[0] - const payload: any = firstQuote - payload.maxAmountOutStr = formatBNToString( - firstQuote.maxAmountOut, - toTokenDecimals - ) - payload.bridgeFeeFormatted = formatBNToString( - firstQuote.feeAmount, - toTokenDecimals - ) + const payload = resp.map((quote) => ({ + ...quote, + maxAmountOutStr: formatBNToString( + quote.maxAmountOut, + toTokenDecimals + ), + bridgeFeeFormatted: formatBNToString( + quote.feeAmount, + toTokenDecimals + ), + })) res.json(payload) }) .catch((err) => { @@ -316,7 +273,7 @@ app.get('/swapTxInfo', async (req, res) => { const query = req.query // Chain - const chainId = query.chain + const chainId = String(query.chain) // Symbols const fromTokenSymbol = String(query.fromToken) @@ -331,7 +288,7 @@ app.get('/swapTxInfo', async (req, res) => { `

    Invalid Params


    - Ensure that your request matches the following format: /swapTxInfo?chain=1&fromToken=USDC&toToken=DAI&amount=100 + Ensure that your request matches the following format: /bridge?fromChain=1&toChain=42161&fromToken=USDC&toToken=USDC&amount=1000000

    Available Tokens (symbols to use)

    ${tokenHtml}` @@ -411,8 +368,8 @@ app.get('/bridgeTxInfo', async (req, res) => { const query = req.query // Chains - const fromChain = query.fromChain - const toChain = query.toChain + const fromChain = String(query.fromChain) + const toChain = String(query.toChain) // Symbols const fromTokenSymbol = String(query.fromToken) @@ -427,7 +384,7 @@ app.get('/bridgeTxInfo', async (req, res) => { `

    Invalid Params


    - Ensure that your request matches the following format: /bridgeTxInfo?fromChain=1&toChain=42161&fromToken=USDC&toToken=USDC&amount=1000000&destAddress=0xcc78d2f004c9de9694ff6a9bbdee4793d30f3842 + Ensure that your request matches the following format: /bridge?fromChain=1&toChain=42161&fromToken=USDC&toToken=USDC&amount=1000000

    Available Tokens (symbols to use)

    ${tokenHtml}` @@ -443,9 +400,6 @@ app.get('/bridgeTxInfo', async (req, res) => { //Get to Address on destination chain const destAddress = String(query.destAddress) - //Router Address: - const routerAddress = '0x7e7a0e201fd38d3adaa9523da6c109a07118c96a' - // Handle invalid params (either token symbols or chainIDs) // TODO: add error handling for missing params if ( @@ -479,20 +433,23 @@ app.get('/bridgeTxInfo', async (req, res) => { toTokenAddress, BigNumber.from(amount) ) - .then((resp) => { - const firstQuote = resp[0] - Synapse.bridge( - destAddress, - routerAddress, - Number(fromChain), - Number(toChain), - fromTokenAddress, - BigNumber.from(amount), - firstQuote.originQuery, - firstQuote.destQuery - ).then((txInfo) => { - res.json(txInfo) - }) + .then(async (resp) => { + const txInfoArray = await Promise.all( + resp.map(async (quote) => { + const txInfo = await Synapse.bridge( + destAddress, + quote.routerAddress, + Number(fromChain), + Number(toChain), + fromTokenAddress, + BigNumber.from(amount), + quote.originQuery, + quote.destQuery + ) + return txInfo + }) + ) + res.json(txInfoArray) }) .catch((err) => { // TODO: do a better return here diff --git a/packages/rest-api/src/config/Chains.ts b/packages/rest-api/src/config/Chains.ts deleted file mode 100644 index 643c1e762e..0000000000 --- a/packages/rest-api/src/config/Chains.ts +++ /dev/null @@ -1,27 +0,0 @@ -interface Chain { - id: number -} - -const CHAINS: Record = { - ETH: { id: 1 }, - OPTIMISM: { id: 10 }, - BNB: { id: 56 }, - POLYGON: { id: 137 }, - FANTOM: { id: 250 }, - ARBITRUM: { id: 42161 }, - AVALANCHE: { id: 43114 }, - MOONRIVER: { id: 1285 }, - BOBA: { id: 288 }, - HARMONY: { id: 1666600000 }, - MOONBEAM: { id: 1284 }, - CRONOS: { id: 25 }, - METIS: { id: 1088 }, - DOGE: { id: 2000 }, - CANTO: { id: 7700 }, - KLAYTN: { id: 8217 }, - DFK: { id: 53935 }, - BASE: { id: 8453 }, - AURORA: { id: 1313161554 }, -} - -export default CHAINS diff --git a/packages/rest-api/src/config/chains.json b/packages/rest-api/src/config/chains.json deleted file mode 100644 index b71fa2f193..0000000000 --- a/packages/rest-api/src/config/chains.json +++ /dev/null @@ -1,92 +0,0 @@ -[ - { - "id": 1, - "name": "Ethereum", - "rpc": "https://rpc.ankr.com/eth" - }, - { - "id": 42161, - "name": "Arbitrum", - "rpc": "https://arb1.arbitrum.io/rpc" - }, - { - "id": 56, - "name": "BSC", - "rpc": "https://bsc-dataseed1.ninicoin.io/" - }, - { - "id": 43114, - "name": "Avalanche", - "rpc": "https://avalanche.public-rpc.com" - }, - { - "id": 7700, - "name": "Canto", - "rpc": "https://mainnode.plexnode.org:8545" - }, - { - "id": 10, - "name": "Optimism", - "rpc": "https://rpc.ankr.com/optimism" - }, - { - "id": 137, - "name": "Polygon", - "rpc": "https://rpc-mainnet.matic.quiknode.pro" - }, - { - "id": 53935, - "name": "DFK Chain", - "rpc": "https://subnets.avax.Chain/defi-kingdoms/dfk-chain/rpc" - }, - { - "id": 8217, - "name": "Klaytn", - "rpc": "https://klaytn.blockpi.Chain/v1/rpc/public" - }, - { - "id": 250, - "name": "Fantom", - "rpc": "https://rpc.ftm.tools" - }, - { - "id": 25, - "name": "Cronos", - "rpc": "https://evm-cronos.crypto.org" - }, - { - "id": 288, - "name": "Boba Chain", - "rpc": "https://mainnet.boba.Chain/" - }, - { - "id": 1088, - "name": "Metis", - "rpc": "https://andromeda.metis.io/?owner=1088" - }, - { - "id": 1313161554, - "name": "Aurora", - "rpc": "https://mainnet.aurora.dev" - }, - { - "id": 1666600000, - "name": "Harmony", - "rpc": "https://harmony-mainnet.chainstacklabs.com" - }, - { - "id": 1284, - "name": "Moonbeam", - "rpc": "https://rpc.api.moonbeam.Chain" - }, - { - "id": 1285, - "name": "Moonriver", - "rpc": "https://rpc.api.moonriver.moonbeam.Chain" - }, - { - "id": 2000, - "name": "Dogechain", - "rpc": "https://rpc-us.dogechain.dog" - } -] \ No newline at end of file diff --git a/packages/rest-api/src/config/bridgeMap.ts b/packages/rest-api/src/constants/bridgeMap.ts similarity index 88% rename from packages/rest-api/src/config/bridgeMap.ts rename to packages/rest-api/src/constants/bridgeMap.ts index 527cebf940..e2ad92cb29 100644 --- a/packages/rest-api/src/config/bridgeMap.ts +++ b/packages/rest-api/src/constants/bridgeMap.ts @@ -21,10 +21,25 @@ export const BRIDGE_MAP = { destination: ['SYN'], swappable: [], }, + '0x12f79f8c1A6e47a9b5F0796FDb008Bdc182fa19e': { + decimals: 18, + symbol: 'JEWEL', + origin: ['JEWEL'], + destination: ['JEWEL'], + swappable: [], + }, '0x1B84765dE8B7566e4cEAF4D0fD3c5aF52D3DdE4F': { decimals: 18, symbol: 'nUSD', - origin: ['CCTP.USDC', 'DAI', 'USDC', 'USDT', 'nUSD', 'synFRAX'], + origin: [ + 'CCTP.USDC', + 'DAI', + 'RFQ.USDC', + 'USDC', + 'USDT', + 'nUSD', + 'synFRAX', + ], destination: ['CCTP.USDC', 'nUSD'], swappable: [ '0x5f98805A4E8be255a32880FDeC7F6728C6568bA0', @@ -53,7 +68,15 @@ export const BRIDGE_MAP = { '0x5f98805A4E8be255a32880FDeC7F6728C6568bA0': { decimals: 18, symbol: 'LUSD', - origin: ['CCTP.USDC', 'DAI', 'USDC', 'USDT', 'nUSD', 'synFRAX'], + origin: [ + 'CCTP.USDC', + 'DAI', + 'RFQ.USDC', + 'USDC', + 'USDT', + 'nUSD', + 'synFRAX', + ], destination: ['CCTP.USDC'], swappable: [ '0x1B84765dE8B7566e4cEAF4D0fD3c5aF52D3DdE4F', @@ -75,7 +98,15 @@ export const BRIDGE_MAP = { '0x6B175474E89094C44Da98b954EedeAC495271d0F': { decimals: 18, symbol: 'DAI', - origin: ['CCTP.USDC', 'DAI', 'USDC', 'USDT', 'nUSD', 'synFRAX'], + origin: [ + 'CCTP.USDC', + 'DAI', + 'RFQ.USDC', + 'USDC', + 'USDT', + 'nUSD', + 'synFRAX', + ], destination: ['CCTP.USDC', 'DAI', 'nUSD'], swappable: [ '0x1B84765dE8B7566e4cEAF4D0fD3c5aF52D3DdE4F', @@ -90,7 +121,15 @@ export const BRIDGE_MAP = { '0x6c3ea9036406852006290770BEdFcAbA0e23A0e8': { decimals: 6, symbol: 'PYUSD', - origin: ['CCTP.USDC', 'DAI', 'USDC', 'USDT', 'nUSD', 'synFRAX'], + origin: [ + 'CCTP.USDC', + 'DAI', + 'RFQ.USDC', + 'USDC', + 'USDT', + 'nUSD', + 'synFRAX', + ], destination: ['CCTP.USDC'], swappable: [ '0x1B84765dE8B7566e4cEAF4D0fD3c5aF52D3DdE4F', @@ -119,7 +158,15 @@ export const BRIDGE_MAP = { '0x853d955aCEf822Db058eb8505911ED77F175b99e': { decimals: 18, symbol: 'FRAX', - origin: ['CCTP.USDC', 'DAI', 'USDC', 'USDT', 'nUSD', 'synFRAX'], + origin: [ + 'CCTP.USDC', + 'DAI', + 'RFQ.USDC', + 'USDC', + 'USDT', + 'nUSD', + 'synFRAX', + ], destination: ['CCTP.USDC', 'synFRAX'], swappable: [ '0x1B84765dE8B7566e4cEAF4D0fD3c5aF52D3DdE4F', @@ -141,8 +188,16 @@ export const BRIDGE_MAP = { '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48': { decimals: 6, symbol: 'USDC', - origin: ['CCTP.USDC', 'DAI', 'USDC', 'USDT', 'nUSD', 'synFRAX'], - destination: ['CCTP.USDC', 'USDC', 'nUSD'], + origin: [ + 'CCTP.USDC', + 'DAI', + 'RFQ.USDC', + 'USDC', + 'USDT', + 'nUSD', + 'synFRAX', + ], + destination: ['CCTP.USDC', 'USDC', 'nUSD', 'RFQ.USDC'], swappable: [ '0x1B84765dE8B7566e4cEAF4D0fD3c5aF52D3DdE4F', '0x5f98805A4E8be255a32880FDeC7F6728C6568bA0', @@ -160,6 +215,13 @@ export const BRIDGE_MAP = { destination: ['VSTA'], swappable: [], }, + '0xAdF7C35560035944e805D98fF17d58CDe2449389': { + decimals: 18, + symbol: 'SPEC', + origin: ['SPEC'], + destination: ['SPEC'], + swappable: [], + }, '0xBAac2B4491727D78D2b78815144570b9f2Fe8899': { decimals: 18, symbol: 'DOG', @@ -170,15 +232,15 @@ export const BRIDGE_MAP = { '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2': { decimals: 18, symbol: 'WETH', - origin: ['nETH'], + origin: ['RFQ.ETH', 'nETH'], destination: ['nETH'], swappable: [], }, '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE': { decimals: 18, symbol: 'ETH', - origin: ['nETH'], - destination: ['nETH'], + origin: ['RFQ.ETH', 'nETH'], + destination: ['nETH', 'RFQ.ETH'], swappable: [], }, '0xb753428af26E81097e7fD17f40c88aaA3E04902c': { @@ -191,7 +253,15 @@ export const BRIDGE_MAP = { '0xdAC17F958D2ee523a2206206994597C13D831ec7': { decimals: 6, symbol: 'USDT', - origin: ['CCTP.USDC', 'DAI', 'USDC', 'USDT', 'nUSD', 'synFRAX'], + origin: [ + 'CCTP.USDC', + 'DAI', + 'RFQ.USDC', + 'USDC', + 'USDT', + 'nUSD', + 'synFRAX', + ], destination: ['CCTP.USDC', 'USDT', 'nUSD'], swappable: [ '0x1B84765dE8B7566e4cEAF4D0fD3c5aF52D3DdE4F', @@ -213,7 +283,15 @@ export const BRIDGE_MAP = { '0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E': { decimals: 18, symbol: 'crvUSD', - origin: ['CCTP.USDC', 'DAI', 'USDC', 'USDT', 'nUSD', 'synFRAX'], + origin: [ + 'CCTP.USDC', + 'DAI', + 'RFQ.USDC', + 'USDC', + 'USDT', + 'nUSD', + 'synFRAX', + ], destination: ['CCTP.USDC'], swappable: [ '0x1B84765dE8B7566e4cEAF4D0fD3c5aF52D3DdE4F', @@ -230,8 +308,8 @@ export const BRIDGE_MAP = { '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85': { decimals: 6, symbol: 'USDC', - origin: ['CCTP.USDC', 'nUSD'], - destination: ['CCTP.USDC'], + origin: ['CCTP.USDC', 'RFQ.USDC', 'nUSD'], + destination: ['CCTP.USDC', 'RFQ.USDC'], swappable: [ '0x67C10C397dD0Ba417329543c1a40eb48AAa7cd00', '0x7F5c764cBc14f9669B88837ca1490cCa17c31607', @@ -250,7 +328,7 @@ export const BRIDGE_MAP = { '0x121ab82b49B2BC4c7901CA46B8277962b4350204': { decimals: 18, symbol: 'WETH', - origin: ['nETH'], + origin: ['RFQ.ETH', 'nETH'], destination: ['nETH'], swappable: [ '0x809DC529f07651bD43A172e8dB6f4a7a0d771036', @@ -274,7 +352,7 @@ export const BRIDGE_MAP = { '0x67C10C397dD0Ba417329543c1a40eb48AAa7cd00': { decimals: 18, symbol: 'nUSD', - origin: ['CCTP.USDC', 'nUSD'], + origin: ['CCTP.USDC', 'RFQ.USDC', 'nUSD'], destination: ['CCTP.USDC', 'nUSD'], swappable: [ '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85', @@ -287,7 +365,7 @@ export const BRIDGE_MAP = { '0x7F5c764cBc14f9669B88837ca1490cCa17c31607': { decimals: 6, symbol: 'USDC.e', - origin: ['CCTP.USDC', 'nUSD'], + origin: ['CCTP.USDC', 'RFQ.USDC', 'nUSD'], destination: ['CCTP.USDC', 'nUSD'], swappable: [ '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85', @@ -300,7 +378,7 @@ export const BRIDGE_MAP = { '0x809DC529f07651bD43A172e8dB6f4a7a0d771036': { decimals: 18, symbol: 'nETH', - origin: ['nETH'], + origin: ['RFQ.ETH', 'nETH'], destination: ['nETH'], swappable: [ '0x121ab82b49B2BC4c7901CA46B8277962b4350204', @@ -310,7 +388,7 @@ export const BRIDGE_MAP = { '0x8c6f28f2F1A3C87F0f938b96d27520d9751ec8d9': { decimals: 18, symbol: 'sUSD', - origin: ['CCTP.USDC', 'nUSD'], + origin: ['CCTP.USDC', 'RFQ.USDC', 'nUSD'], destination: ['CCTP.USDC'], swappable: [ '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85', @@ -323,7 +401,7 @@ export const BRIDGE_MAP = { '0x94b008aA00579c1307B0EF2c499aD98a8ce58e58': { decimals: 6, symbol: 'USDT', - origin: ['CCTP.USDC', 'nUSD'], + origin: ['CCTP.USDC', 'RFQ.USDC', 'nUSD'], destination: ['CCTP.USDC'], swappable: [ '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85', @@ -343,7 +421,7 @@ export const BRIDGE_MAP = { '0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1': { decimals: 18, symbol: 'DAI', - origin: ['CCTP.USDC', 'nUSD'], + origin: ['CCTP.USDC', 'RFQ.USDC', 'nUSD'], destination: ['CCTP.USDC'], swappable: [ '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85', @@ -363,8 +441,8 @@ export const BRIDGE_MAP = { '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE': { decimals: 18, symbol: 'ETH', - origin: ['nETH'], - destination: ['nETH'], + origin: ['RFQ.ETH', 'nETH'], + destination: ['nETH', 'RFQ.ETH'], swappable: [ '0x121ab82b49B2BC4c7901CA46B8277962b4350204', '0x809DC529f07651bD43A172e8dB6f4a7a0d771036', @@ -795,6 +873,13 @@ export const BRIDGE_MAP = { }, }, '1088': { + '0x17C09cfC96C865CF546d73365Cedb6dC66986963': { + decimals: 18, + symbol: 'JEWEL', + origin: ['JEWEL'], + destination: ['JEWEL'], + swappable: [], + }, '0x420000000000000000000000000000000000000A': { decimals: 18, symbol: 'WETH', @@ -1025,7 +1110,7 @@ export const BRIDGE_MAP = { symbol: 'nETH', origin: ['nETH'], destination: ['nETH'], - swappable: ['0x5FD55A1B9FC24967C4dB09C513C3BA0DFa7FF687'], + swappable: [], }, '0x4e71A2E537B7f9D9413D3991D37958c0b5e1e503': { decimals: 18, @@ -1045,13 +1130,6 @@ export const BRIDGE_MAP = { destination: ['SYN'], swappable: [], }, - '0x5FD55A1B9FC24967C4dB09C513C3BA0DFa7FF687': { - decimals: 18, - symbol: 'ETH', - origin: ['nETH'], - destination: ['nETH'], - swappable: ['0x09fEC30669d63A13c666d2129230dD5588E2e240'], - }, '0x80b5a32E4F032B2a058b4F29EC95EEfEEB87aDcd': { decimals: 6, symbol: 'USDC', @@ -1169,7 +1247,7 @@ export const BRIDGE_MAP = { '0x417Ac0e078398C154EdFadD9Ef675d30Be60Af93': { decimals: 18, symbol: 'crvUSD', - origin: ['CCTP.USDC'], + origin: ['CCTP.USDC', 'RFQ.USDC'], destination: ['CCTP.USDC'], swappable: [ '0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb', @@ -1181,7 +1259,7 @@ export const BRIDGE_MAP = { '0x4200000000000000000000000000000000000006': { decimals: 18, symbol: 'WETH', - origin: ['nETH'], + origin: ['RFQ.ETH', 'nETH'], destination: ['nETH'], swappable: [ '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', @@ -1198,7 +1276,7 @@ export const BRIDGE_MAP = { '0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb': { decimals: 18, symbol: 'DAI', - origin: ['CCTP.USDC'], + origin: ['CCTP.USDC', 'RFQ.USDC'], destination: ['CCTP.USDC'], swappable: [ '0x417Ac0e078398C154EdFadD9Ef675d30Be60Af93', @@ -1217,8 +1295,8 @@ export const BRIDGE_MAP = { '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913': { decimals: 6, symbol: 'USDC', - origin: ['CCTP.USDC'], - destination: ['CCTP.USDC'], + origin: ['CCTP.USDC', 'RFQ.USDC'], + destination: ['CCTP.USDC', 'RFQ.USDC'], swappable: [ '0x417Ac0e078398C154EdFadD9Ef675d30Be60Af93', '0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb', @@ -1226,10 +1304,17 @@ export const BRIDGE_MAP = { '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA', ], }, + '0x96419929d7949D6A801A6909c145C8EEf6A40431': { + decimals: 18, + symbol: 'SPEC', + origin: ['SPEC'], + destination: ['SPEC'], + swappable: [], + }, '0xEB466342C4d449BC9f53A865D5Cb90586f405215': { decimals: 6, symbol: 'axlUSDC', - origin: ['CCTP.USDC'], + origin: ['CCTP.USDC', 'RFQ.USDC'], destination: ['CCTP.USDC'], swappable: [ '0x417Ac0e078398C154EdFadD9Ef675d30Be60Af93', @@ -1241,8 +1326,8 @@ export const BRIDGE_MAP = { '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE': { decimals: 18, symbol: 'ETH', - origin: ['nETH'], - destination: ['nETH'], + origin: ['RFQ.ETH', 'nETH'], + destination: ['nETH', 'RFQ.ETH'], swappable: [ '0x4200000000000000000000000000000000000006', '0xb554A55358fF0382Fb21F0a478C3546d1106Be8c', @@ -1251,7 +1336,7 @@ export const BRIDGE_MAP = { '0xb554A55358fF0382Fb21F0a478C3546d1106Be8c': { decimals: 18, symbol: 'nETH', - origin: ['nETH'], + origin: ['RFQ.ETH', 'nETH'], destination: ['nETH'], swappable: [ '0x4200000000000000000000000000000000000006', @@ -1261,7 +1346,7 @@ export const BRIDGE_MAP = { '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA': { decimals: 6, symbol: 'USDbC', - origin: ['CCTP.USDC'], + origin: ['CCTP.USDC', 'RFQ.USDC'], destination: ['CCTP.USDC'], swappable: [ '0x417Ac0e078398C154EdFadD9Ef675d30Be60Af93', @@ -1296,7 +1381,7 @@ export const BRIDGE_MAP = { '0x17FC002b466eEc40DaE837Fc4bE5c67993ddBd6F': { decimals: 18, symbol: 'FRAX', - origin: ['CCTP.USDC', 'nUSD'], + origin: ['CCTP.USDC', 'RFQ.USDC', 'nUSD'], destination: ['CCTP.USDC'], swappable: [ '0x2913E812Cf0dcCA30FB28E6Cac3d2DCFF4497688', @@ -1309,7 +1394,7 @@ export const BRIDGE_MAP = { '0x2913E812Cf0dcCA30FB28E6Cac3d2DCFF4497688': { decimals: 18, symbol: 'nUSD', - origin: ['CCTP.USDC', 'nUSD'], + origin: ['CCTP.USDC', 'RFQ.USDC', 'nUSD'], destination: ['CCTP.USDC', 'nUSD'], swappable: [ '0x17FC002b466eEc40DaE837Fc4bE5c67993ddBd6F', @@ -1329,7 +1414,7 @@ export const BRIDGE_MAP = { '0x3ea9B0ab55F34Fb188824Ee288CeaEfC63cf908e': { decimals: 18, symbol: 'nETH', - origin: ['nETH'], + origin: ['RFQ.ETH', 'nETH'], destination: ['nETH'], swappable: [ '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1', @@ -1353,7 +1438,7 @@ export const BRIDGE_MAP = { '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1': { decimals: 18, symbol: 'WETH', - origin: ['nETH'], + origin: ['RFQ.ETH', 'nETH'], destination: ['nETH'], swappable: [ '0x3ea9B0ab55F34Fb188824Ee288CeaEfC63cf908e', @@ -1384,7 +1469,7 @@ export const BRIDGE_MAP = { '0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1': { decimals: 18, symbol: 'DAI', - origin: ['CCTP.USDC', 'nUSD'], + origin: ['CCTP.USDC', 'RFQ.USDC', 'nUSD'], destination: ['CCTP.USDC'], swappable: [ '0x17FC002b466eEc40DaE837Fc4bE5c67993ddBd6F', @@ -1397,8 +1482,8 @@ export const BRIDGE_MAP = { '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE': { decimals: 18, symbol: 'ETH', - origin: ['nETH'], - destination: ['nETH'], + origin: ['RFQ.ETH', 'nETH'], + destination: ['nETH', 'RFQ.ETH'], swappable: [ '0x3ea9B0ab55F34Fb188824Ee288CeaEfC63cf908e', '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1', @@ -1407,7 +1492,7 @@ export const BRIDGE_MAP = { '0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8': { decimals: 6, symbol: 'USDC.e', - origin: ['CCTP.USDC', 'nUSD'], + origin: ['CCTP.USDC', 'RFQ.USDC', 'nUSD'], destination: ['CCTP.USDC', 'nUSD'], swappable: [ '0x17FC002b466eEc40DaE837Fc4bE5c67993ddBd6F', @@ -1420,7 +1505,7 @@ export const BRIDGE_MAP = { '0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9': { decimals: 6, symbol: 'USDT', - origin: ['CCTP.USDC', 'nUSD'], + origin: ['CCTP.USDC', 'RFQ.USDC', 'nUSD'], destination: ['CCTP.USDC', 'nUSD'], swappable: [ '0x17FC002b466eEc40DaE837Fc4bE5c67993ddBd6F', @@ -1440,8 +1525,8 @@ export const BRIDGE_MAP = { '0xaf88d065e77c8cC2239327C5EDb3A432268e5831': { decimals: 6, symbol: 'USDC', - origin: ['CCTP.USDC', 'nUSD'], - destination: ['CCTP.USDC'], + origin: ['CCTP.USDC', 'RFQ.USDC', 'nUSD'], + destination: ['CCTP.USDC', 'RFQ.USDC'], swappable: [ '0x17FC002b466eEc40DaE837Fc4bE5c67993ddBd6F', '0x2913E812Cf0dcCA30FB28E6Cac3d2DCFF4497688', @@ -1708,6 +1793,119 @@ export const BRIDGE_MAP = { swappable: [], }, }, + '59144': { + '0x176211869cA2b568f2A7D4EE941E073a821EE1ff': { + decimals: 6, + symbol: 'USDC', + origin: ['RFQ.USDC'], + destination: ['RFQ.USDC'], + swappable: ['0xA219439258ca9da29E9Cc4cE5596924745e12B93'], + }, + '0xA219439258ca9da29E9Cc4cE5596924745e12B93': { + decimals: 6, + symbol: 'USDT', + origin: ['RFQ.USDC'], + destination: [], + swappable: ['0x176211869cA2b568f2A7D4EE941E073a821EE1ff'], + }, + '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE': { + decimals: 18, + symbol: 'ETH', + origin: ['RFQ.ETH'], + destination: ['RFQ.ETH'], + swappable: [], + }, + '0xe5D7C2a44FfDDf6b295A15c148167daaAf5Cf34f': { + decimals: 18, + symbol: 'WETH', + origin: ['RFQ.ETH'], + destination: [], + swappable: [], + }, + }, + '81457': { + '0x3194B0A295D87fDAA54DF852c248F7a6BAF6c6e0': { + decimals: 18, + symbol: 'nUSD', + origin: ['nUSD'], + destination: ['nUSD'], + swappable: ['0x4300000000000000000000000000000000000003'], + }, + '0x4300000000000000000000000000000000000003': { + decimals: 18, + symbol: 'USDB', + origin: ['nUSD'], + destination: ['nUSD'], + swappable: ['0x3194B0A295D87fDAA54DF852c248F7a6BAF6c6e0'], + }, + '0x4300000000000000000000000000000000000004': { + decimals: 18, + symbol: 'WETH', + origin: ['RFQ.ETH', 'nETH'], + destination: ['nETH'], + swappable: [ + '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', + '0xce971282fAAc9faBcF121944956da7142cccC855', + ], + }, + '0x9592f08387134e218327E6E8423400eb845EdE0E': { + decimals: 18, + symbol: 'SYN', + origin: ['SYN'], + destination: ['SYN'], + swappable: [], + }, + '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE': { + decimals: 18, + symbol: 'ETH', + origin: ['RFQ.ETH', 'nETH'], + destination: ['nETH', 'RFQ.ETH'], + swappable: [ + '0x4300000000000000000000000000000000000004', + '0xce971282fAAc9faBcF121944956da7142cccC855', + ], + }, + '0xce971282fAAc9faBcF121944956da7142cccC855': { + decimals: 18, + symbol: 'nETH', + origin: ['RFQ.ETH', 'nETH'], + destination: ['nETH'], + swappable: [ + '0x4300000000000000000000000000000000000004', + '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', + ], + }, + }, + '534352': { + '0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4': { + decimals: 6, + symbol: 'USDC', + origin: ['RFQ.USDC'], + destination: ['RFQ.USDC'], + swappable: ['0xf55BEC9cafDbE8730f096Aa55dad6D22d44099Df'], + }, + '0x5300000000000000000000000000000000000004': { + decimals: 18, + symbol: 'WETH', + origin: ['RFQ.ETH'], + destination: [], + swappable: [], + }, + '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE': { + decimals: 18, + symbol: 'ETH', + origin: ['RFQ.ETH'], + destination: ['RFQ.ETH'], + swappable: [], + }, + '0xf55BEC9cafDbE8730f096Aa55dad6D22d44099Df': { + decimals: 6, + symbol: 'USDT', + origin: ['RFQ.USDC'], + destination: [], + swappable: ['0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4'], + }, + }, '1313161554': { '0x07379565cD8B0CaE7c60Dc78e7f601b34AF2A21c': { decimals: 18, diff --git a/packages/rest-api/src/config/bridgeable.ts b/packages/rest-api/src/constants/bridgeable.ts similarity index 53% rename from packages/rest-api/src/config/bridgeable.ts rename to packages/rest-api/src/constants/bridgeable.ts index 413e1e726c..f6a919ce79 100644 --- a/packages/rest-api/src/config/bridgeable.ts +++ b/packages/rest-api/src/constants/bridgeable.ts @@ -1,12 +1,13 @@ -import { Token } from './Token' -import CHAINS from './Chains' -const zeroAddress = '0x0000000000000000000000000000000000000000' +import { BridgeableToken } from '../types' +import { CHAINS } from './chains' -export const GOHM = new Token({ +const ZeroAddress = '0x0000000000000000000000000000000000000000' + +export const GOHM: BridgeableToken = { addresses: { - [CHAINS.ETH.id]: '0x0ab87046fBb341D058F17CBC4c1133F25a20a52f', + [CHAINS.ETHEREUM.id]: '0x0ab87046fBb341D058F17CBC4c1133F25a20a52f', [CHAINS.OPTIMISM.id]: '0x0b5740c6b4a97f90eF2F0220651Cca420B868FfB', - [CHAINS.BNB.id]: '0x88918495892BAF4536611E38E75D771Dc6Ec0863', + [CHAINS.BNBCHAIN.id]: '0x88918495892BAF4536611E38E75D771Dc6Ec0863', [CHAINS.POLYGON.id]: '0xd8cA34fd379d9ca3C6Ee3b3905678320F5b45195', [CHAINS.FANTOM.id]: '0x91fa20244Fb509e8289CA630E5db3E9166233FDc', [CHAINS.ARBITRUM.id]: '0x8D9bA570D6cb60C7e3e0F31343Efe75AB8E65FB1', @@ -18,312 +19,413 @@ export const GOHM = new Token({ [CHAINS.CRONOS.id]: '0xbB0A63A6CA2071c6C4bcAC11a1A317b20E3E999C', [CHAINS.METIS.id]: '0xFB21B70922B9f6e3C6274BcD6CB1aa8A0fe20B80', }, - decimals: 18, + decimals: { + [CHAINS.ETHEREUM.id]: 18, + [CHAINS.OPTIMISM.id]: 18, + [CHAINS.BNBCHAIN.id]: 18, + [CHAINS.POLYGON.id]: 18, + [CHAINS.FANTOM.id]: 18, + [CHAINS.ARBITRUM.id]: 18, + [CHAINS.AVALANCHE.id]: 18, + [CHAINS.MOONRIVER.id]: 18, + [CHAINS.BOBA.id]: 18, + [CHAINS.HARMONY.id]: 18, + [CHAINS.MOONBEAM.id]: 18, + [CHAINS.CRONOS.id]: 18, + [CHAINS.METIS.id]: 18, + }, + symbol: 'gOHM', name: 'Olympus DAO', swapableType: 'OHM', color: 'gray', - visibilityRank: 40, priorityRank: 600, routeSymbol: 'gOHM', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/ohm.1b779b45.svg', +} -export const LINK = new Token({ +export const LINK: BridgeableToken = { addresses: { - [CHAINS.ETH.id]: '0x514910771af9ca656af840dff83e8264ecf986ca', + [CHAINS.ETHEREUM.id]: '0x514910771af9ca656af840dff83e8264ecf986ca', [CHAINS.KLAYTN.id]: '0xfbed1abb3ad0f8c467068de9fde905887e8c9118', }, - decimals: 18, + decimals: { + [CHAINS.ETHEREUM.id]: 18, + [CHAINS.KLAYTN.id]: 18, + }, symbol: 'LINK', name: 'ChainLink Token', swapableType: 'LINK', color: 'blue', priorityRank: 600, routeSymbol: 'LINK', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/link.bdd944c9.svg', +} -export const HIGH = new Token({ +export const HIGH: BridgeableToken = { addresses: { - [CHAINS.ETH.id]: '0x71Ab77b7dbB4fa7e017BC15090b2163221420282', - [CHAINS.BNB.id]: '0x5f4bde007dc06b867f86ebfe4802e34a1ffeed63', + [CHAINS.ETHEREUM.id]: '0x71Ab77b7dbB4fa7e017BC15090b2163221420282', + [CHAINS.BNBCHAIN.id]: '0x5f4bde007dc06b867f86ebfe4802e34a1ffeed63', }, - decimals: 18, + decimals: { [CHAINS.ETHEREUM.id]: 18, [CHAINS.BNBCHAIN.id]: 18 }, symbol: 'HIGH', name: 'Highstreet', swapableType: 'HIGH', color: 'cyan', priorityRank: 600, routeSymbol: 'HIGH', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/highstreet.e8060cc0.svg', +} -export const JUMP = new Token({ +export const JUMP: BridgeableToken = { addresses: { - [CHAINS.BNB.id]: '0x130025ee738a66e691e6a7a62381cb33c6d9ae83', + [CHAINS.BNBCHAIN.id]: '0x130025ee738a66e691e6a7a62381cb33c6d9ae83', [CHAINS.FANTOM.id]: '0x78DE9326792ce1d6eCA0c978753c6953Cdeedd73', [CHAINS.METIS.id]: '0xE3c82A836Ec85311a433fBd9486EfAF4b1AFbF48', }, - decimals: 18, + decimals: { + [CHAINS.BNBCHAIN.id]: 18, + [CHAINS.FANTOM.id]: 18, + [CHAINS.METIS.id]: 18, + }, symbol: 'JUMP', name: 'HyperJump', - docUrl: '', swapableType: 'JUMP', color: 'cyan', priorityRank: 600, routeSymbol: 'JUMP', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/hyperjump.e48ce883.svg', +} -export const SFI = new Token({ +export const SFI: BridgeableToken = { addresses: { - [CHAINS.ETH.id]: '0xb753428af26e81097e7fd17f40c88aaa3e04902c', + [CHAINS.ETHEREUM.id]: '0xb753428af26e81097e7fd17f40c88aaa3e04902c', [CHAINS.AVALANCHE.id]: '0xc2Bf0A1f7D8Da50D608bc96CF701110d4A438312', }, - decimals: 18, + decimals: { + [CHAINS.ETHEREUM.id]: 18, + [CHAINS.AVALANCHE.id]: 18, + }, symbol: 'SFI', name: 'Saffron Finance', - docUrl: '', swapableType: 'SFI', color: 'red', priorityRank: 600, routeSymbol: 'SFI', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/sfi.4e35fbac.svg', +} -export const DOG = new Token({ +export const DOG: BridgeableToken = { addresses: { - [CHAINS.ETH.id]: '0xBAac2B4491727D78D2b78815144570b9f2Fe8899', - [CHAINS.BNB.id]: '0xaa88c603d142c371ea0eac8756123c5805edee03', + [CHAINS.ETHEREUM.id]: '0xBAac2B4491727D78D2b78815144570b9f2Fe8899', + [CHAINS.BNBCHAIN.id]: '0xaa88c603d142c371ea0eac8756123c5805edee03', [CHAINS.POLYGON.id]: '0xeEe3371B89FC43Ea970E908536Fcddd975135D8a', }, - decimals: 18, + decimals: { + [CHAINS.ETHEREUM.id]: 18, + [CHAINS.BNBCHAIN.id]: 18, + [CHAINS.POLYGON.id]: 18, + }, symbol: 'DOG', name: 'The Doge NFT', - docUrl: '', swapableType: 'DOG', color: 'yellow', priorityRank: 600, routeSymbol: 'DOG', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/dog.b3513f9b.svg', +} -export const NFD = new Token({ +export const NFD: BridgeableToken = { addresses: { - [CHAINS.BNB.id]: '0x0fe9778c005a5a6115cbe12b0568a2d50b765a51', + [CHAINS.BNBCHAIN.id]: '0x0fe9778c005a5a6115cbe12b0568a2d50b765a51', [CHAINS.AVALANCHE.id]: '0xf1293574ee43950e7a8c9f1005ff097a9a713959', [CHAINS.DOGE.id]: '0x868055ADFA27D331d5b69b1BF3469aDAAc3ba7f2', [CHAINS.POLYGON.id]: '0x0a5926027d407222f8fe20f24cb16e103f617046', }, - decimals: 18, + decimals: { + [CHAINS.BNBCHAIN.id]: 18, + [CHAINS.AVALANCHE.id]: 18, + [CHAINS.DOGE.id]: 18, + [CHAINS.POLYGON.id]: 18, + }, symbol: 'NFD', name: 'Feisty Doge', - docUrl: '', swapableType: 'NFD', color: 'yellow', priorityRank: 600, routeSymbol: 'NFD', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/nfd.1212b18d.svg', +} -export const SOLAR = new Token({ +export const SOLAR: BridgeableToken = { addresses: { [CHAINS.MOONBEAM.id]: '0x0DB6729C03C85B0708166cA92801BcB5CAc781fC', [CHAINS.MOONRIVER.id]: '0x76906411D07815491A5E577022757aD941fb5066', }, - decimals: 18, + decimals: { + [CHAINS.MOONBEAM.id]: 18, + [CHAINS.MOONRIVER.id]: 18, + }, symbol: 'veSOLAR', name: 'Vested SolarBeam', - docUrl: '', swapableType: 'SOLAR', color: 'orange', priorityRank: 600, routeSymbol: 'veSOLAR', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/solar.add1885e.svg', +} -export const GMX = new Token({ +export const GMX: BridgeableToken = { addresses: { [CHAINS.ARBITRUM.id]: '0xfc5a1a6eb076a2c7ad06ed22c90d7e710e35ad0a', [CHAINS.AVALANCHE.id]: '0x62edc0692bd897d2295872a9ffcac5425011c661', }, - wrapperAddresses: { - [CHAINS.AVALANCHE.id]: '0x20A9DC684B4d0407EF8C9A302BEAaA18ee15F656', + decimals: { + [CHAINS.ARBITRUM.id]: 18, + [CHAINS.AVALANCHE.id]: 18, }, - decimals: 18, symbol: 'GMX', name: 'GMX', - docUrl: '', swapableType: 'GMX', priorityRank: 250, color: 'blue', routeSymbol: 'GMX', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/gmx.0e372310.svg', +} -export const SDT = new Token({ +export const SDT: BridgeableToken = { addresses: { - [CHAINS.ETH.id]: '0x73968b9a57c6e53d41345fd57a6e6ae27d6cdb2f', + [CHAINS.ETHEREUM.id]: '0x73968b9a57c6e53d41345fd57a6e6ae27d6cdb2f', [CHAINS.AVALANCHE.id]: '0xCCBf7c451F81752F7d2237F2c18C371E6e089E69', [CHAINS.ARBITRUM.id]: '0x087d18A77465c34CDFd3a081a2504b7E86CE4EF8', [CHAINS.FANTOM.id]: '0xE3c82A836Ec85311a433fBd9486EfAF4b1AFbF48', [CHAINS.HARMONY.id]: '0xE3c82A836Ec85311a433fBd9486EfAF4b1AFbF48', }, - decimals: 18, + decimals: { + [CHAINS.ETHEREUM.id]: 18, + [CHAINS.AVALANCHE.id]: 18, + [CHAINS.ARBITRUM.id]: 18, + [CHAINS.FANTOM.id]: 18, + [CHAINS.HARMONY.id]: 18, + }, symbol: 'SDT', name: 'Stake DAO', - docUrl: '', swapableType: 'SDT', color: 'gray', priorityRank: 600, routeSymbol: 'SDT', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/sdt.c37b0b67.svg', +} -export const NEWO = new Token({ +export const NEWO: BridgeableToken = { addresses: { - [CHAINS.ETH.id]: '0x98585dFc8d9e7D48F0b1aE47ce33332CF4237D96', + [CHAINS.ETHEREUM.id]: '0x98585dFc8d9e7D48F0b1aE47ce33332CF4237D96', [CHAINS.AVALANCHE.id]: '0x4Bfc90322dD638F81F034517359BD447f8E0235a', [CHAINS.ARBITRUM.id]: '0x0877154a755B24D499B8e2bD7ecD54d3c92BA433', }, - decimals: 18, + decimals: { + [CHAINS.ETHEREUM.id]: 18, + [CHAINS.AVALANCHE.id]: 18, + [CHAINS.ARBITRUM.id]: 18, + }, symbol: 'NEWO', name: 'New Order', - docUrl: '', swapableType: 'NEWO', color: 'yellow', priorityRank: 600, routeSymbol: 'NEWO', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/newo.3c9ae85e.svg', +} -export const PEPE = new Token({ +export const PEPE: BridgeableToken = { addresses: { - [CHAINS.ETH.id]: '0x6982508145454ce325ddbe47a25d4ec3d2311933', + [CHAINS.ETHEREUM.id]: '0x6982508145454ce325ddbe47a25d4ec3d2311933', [CHAINS.ARBITRUM.id]: '0xA54B8e178A49F8e5405A4d44Bb31F496e5564A05', }, - decimals: 18, + decimals: { + [CHAINS.ETHEREUM.id]: 18, + [CHAINS.ARBITRUM.id]: 18, + }, symbol: 'PEPE', name: 'Pepe', swapableType: 'PEPE', priorityRank: 600, routeSymbol: 'PEPE', color: 'green', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/pepe.5da81140.svg', +} -export const VSTA = new Token({ +export const VSTA: BridgeableToken = { addresses: { - [CHAINS.ETH.id]: '0xA8d7F5e7C78ed0Fa097Cc5Ec66C1DC3104c9bbeb', + [CHAINS.ETHEREUM.id]: '0xA8d7F5e7C78ed0Fa097Cc5Ec66C1DC3104c9bbeb', [CHAINS.ARBITRUM.id]: '0xa684cd057951541187f288294a1e1c2646aa2d24', }, - decimals: 18, + decimals: { + [CHAINS.ETHEREUM.id]: 18, + [CHAINS.ARBITRUM.id]: 18, + }, symbol: 'VSTA', name: 'Vesta', - docUrl: '', swapableType: 'VSTA', color: 'gray', priorityRank: 600, routeSymbol: 'VSTA', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/vsta.56aa9f41.svg', +} -export const H2O = new Token({ +export const H2O: BridgeableToken = { addresses: { - [CHAINS.ETH.id]: '0x0642026e7f0b6ccac5925b4e7fa61384250e1701', + [CHAINS.ETHEREUM.id]: '0x0642026e7f0b6ccac5925b4e7fa61384250e1701', [CHAINS.ARBITRUM.id]: '0xD1c6f989e9552DB523aBAE2378227fBb059a3976', [CHAINS.AVALANCHE.id]: '0xC6b11a4Fd833d1117E9D312c02865647cd961107', - [CHAINS.BNB.id]: '0x03eFca7CEb108734D3777684F3C0A0d8ad652f79', + [CHAINS.BNBCHAIN.id]: '0x03eFca7CEb108734D3777684F3C0A0d8ad652f79', [CHAINS.MOONBEAM.id]: '0xA46aDF6D5881ca0b8596EDadF8f058F8c16d8B68', [CHAINS.MOONRIVER.id]: '0x9c0a820bb01e2807aCcd1c682d359e92DDd41403', [CHAINS.OPTIMISM.id]: '0xE3c82A836Ec85311a433fBd9486EfAF4b1AFbF48', [CHAINS.POLYGON.id]: '0x32ba7cF7d681357529013de6a2CDF93933C0dF3f', }, - decimals: 18, + decimals: { + [CHAINS.ETHEREUM.id]: 18, + [CHAINS.ARBITRUM.id]: 18, + [CHAINS.AVALANCHE.id]: 18, + [CHAINS.BNBCHAIN.id]: 18, + [CHAINS.MOONBEAM.id]: 18, + [CHAINS.MOONRIVER.id]: 18, + [CHAINS.OPTIMISM.id]: 18, + [CHAINS.POLYGON.id]: 18, + }, symbol: 'H2O', name: 'H2O', - docUrl: '', swapableType: 'H2O', color: 'cyan', priorityRank: 600, routeSymbol: 'H2O', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/h2o.108c0951.svg', +} -export const L2DAO = new Token({ +export const L2DAO: BridgeableToken = { addresses: { [CHAINS.ARBITRUM.id]: '0x2CaB3abfC1670D1a452dF502e216a66883cDf079', [CHAINS.OPTIMISM.id]: '0xd52f94DF742a6F4B4C8b033369fE13A41782Bf44', }, - decimals: 18, + decimals: { + [CHAINS.ARBITRUM.id]: 18, + [CHAINS.OPTIMISM.id]: 18, + }, symbol: 'L2DAO', name: 'Layer2DAO', - docUrl: '', swapableType: 'L2DAO', color: 'cyan', priorityRank: 600, routeSymbol: 'L2DAO', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/l2dao.0d1dd411.svg', +} -export const PLS = new Token({ +export const PLS: BridgeableToken = { addresses: { [CHAINS.ARBITRUM.id]: '0x51318b7d00db7acc4026c88c3952b66278b6a67f', [CHAINS.OPTIMISM.id]: '0xD9eAA386cCD65F30b77FF175F6b52115FE454fD6', }, - decimals: 18, + decimals: { + [CHAINS.ARBITRUM.id]: 18, + [CHAINS.OPTIMISM.id]: 18, + }, symbol: 'PLS', name: 'Plutus', - docUrl: '', swapableType: 'PLS', color: 'green', priorityRank: 600, routeSymbol: 'PLS', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/pls.a97f40f2.svg', +} -export const AGEUR = new Token({ +export const AGEUR: BridgeableToken = { addresses: { - [CHAINS.ETH.id]: '0x1a7e4e63778B4f12a199C062f3eFdD288afCBce8', + [CHAINS.ETHEREUM.id]: '0x1a7e4e63778B4f12a199C062f3eFdD288afCBce8', [CHAINS.ARBITRUM.id]: '0x16BFc5fe024980124bEf51d1D792dC539d1B5Bf0', [CHAINS.OPTIMISM.id]: '0xa0554607e477cdC9d0EE2A6b087F4b2DC2815C22', }, - decimals: 18, + decimals: { + [CHAINS.ETHEREUM.id]: 18, + [CHAINS.ARBITRUM.id]: 18, + [CHAINS.OPTIMISM.id]: 18, + }, symbol: 'agEUR', name: 'Angle Euro', - docUrl: '', swapableType: 'AGEUR', color: 'yellow', priorityRank: 600, routeSymbol: 'agEUR', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/ageur.588833db.svg', +} -export const UNIDX = new Token({ +export const UNIDX: BridgeableToken = { addresses: { - [CHAINS.ETH.id]: '0xf0655dcee37e5c0b70fffd70d85f88f8edf0aff6', + [CHAINS.ETHEREUM.id]: '0xf0655dcee37e5c0b70fffd70d85f88f8edf0aff6', [CHAINS.ARBITRUM.id]: '0x5429706887FCb58a595677B73E9B0441C25d993D', [CHAINS.FANTOM.id]: '0x0483a76D80D0aFEC6bd2afd12C1AD865b9DF1471', [CHAINS.OPTIMISM.id]: '0x28b42698Caf46B4B012CF38b6C75867E0762186D', [CHAINS.BASE.id]: '0x6B4712AE9797C199edd44F897cA09BC57628a1CF', }, - decimals: 18, + decimals: { + [CHAINS.ETHEREUM.id]: 18, + [CHAINS.ARBITRUM.id]: 18, + [CHAINS.FANTOM.id]: 18, + [CHAINS.OPTIMISM.id]: 18, + [CHAINS.BASE.id]: 18, + }, symbol: 'UNIDX', name: 'Unidex', - docUrl: '', swapableType: 'UNIDX', color: 'gray', priorityRank: 600, routeSymbol: 'UNIDX', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/unidex.29d556df.svg', +} -export const BUSD = new Token({ +export const BUSD: BridgeableToken = { addresses: { - [CHAINS.BNB.id]: '0xe9e7cea3dedca5984780bafc599bd69add087d56', + [CHAINS.BNBCHAIN.id]: '0xe9e7cea3dedca5984780bafc599bd69add087d56', [CHAINS.DOGE.id]: '0x1555C68Be3b22cdcCa934Ae88Cb929Db40aB311d', }, - decimals: 18, + decimals: { + [CHAINS.BNBCHAIN.id]: 18, + [CHAINS.DOGE.id]: 18, + }, symbol: 'BUSD', name: 'Binance USD', swapableType: 'BUSD', - swapableOn: [CHAINS.BNB.id], color: 'yellow', priorityRank: 200, routeSymbol: 'BUSD', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/busd.e8bb5032.svg', +} -export const USDC = new Token({ - visibilityRank: 101, +export const USDC: BridgeableToken = { addresses: { - [CHAINS.ETH.id]: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', + [CHAINS.ETHEREUM.id]: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', [CHAINS.OPTIMISM.id]: '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85', [CHAINS.CRONOS.id]: '0xc21223249ca28397b4b6541dffaecc539bff0c59', - [CHAINS.BNB.id]: '0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d', - [CHAINS.POLYGON.id]: '0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359', + [CHAINS.BNBCHAIN.id]: '0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d', [CHAINS.BOBA.id]: '0x66a2A913e447d6b4BF33EFbec43aAeF87890FBbc', [CHAINS.DOGE.id]: '0x85C2D3bEBffD83025910985389aB8aD655aBC946', [CHAINS.CANTO.id]: '0x80b5a32E4F032B2a058b4F29EC95EEfEEB87aDcd', @@ -332,13 +434,15 @@ export const USDC = new Token({ [CHAINS.AVALANCHE.id]: '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e', [CHAINS.DFK.id]: '0x3AD9DFE640E1A9Cc1D9B0948620820D975c3803a', [CHAINS.BASE.id]: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', + [CHAINS.POLYGON.id]: '0x2791bca1f2de4661ed88a30c99a7a9449aa84174', + [CHAINS.SCROLL.id]: '0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4', + [CHAINS.LINEA.id]: '0x176211869cA2b568f2A7D4EE941E073a821EE1ff', }, decimals: { - [CHAINS.ETH.id]: 6, + [CHAINS.ETHEREUM.id]: 6, [CHAINS.OPTIMISM.id]: 6, [CHAINS.CRONOS.id]: 6, - [CHAINS.BNB.id]: 18, - [CHAINS.POLYGON.id]: 6, + [CHAINS.BNBCHAIN.id]: 18, [CHAINS.BOBA.id]: 6, [CHAINS.DOGE.id]: 6, [CHAINS.CANTO.id]: 6, @@ -347,35 +451,21 @@ export const USDC = new Token({ [CHAINS.AVALANCHE.id]: 6, [CHAINS.DFK.id]: 18, [CHAINS.BASE.id]: 6, - }, - swapExceptions: { - [CHAINS.KLAYTN.id]: [CHAINS.ETH.id, CHAINS.DOGE.id], - [CHAINS.DOGE.id]: [CHAINS.ETH.id, CHAINS.DOGE.id], + [CHAINS.POLYGON.id]: 6, + [CHAINS.SCROLL.id]: 6, + [CHAINS.LINEA.id]: 6, }, symbol: 'USDC', name: 'USD Coin', swapableType: 'USD', - swapableOn: [ - CHAINS.BNB.id, - CHAINS.ETH.id, - CHAINS.POLYGON.id, - CHAINS.ARBITRUM.id, - CHAINS.AVALANCHE.id, - CHAINS.HARMONY.id, - CHAINS.AURORA.id, - CHAINS.BOBA.id, - CHAINS.OPTIMISM.id, - CHAINS.METIS.id, - CHAINS.CRONOS.id, - CHAINS.CANTO.id, - ], color: 'blue', priorityRank: 100, routeSymbol: 'USDC', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/usdc.d5dcb030.svg', +} -export const METISUSDC = new Token({ - visibilityRank: 101, +export const METISUSDC: BridgeableToken = { addresses: { [CHAINS.METIS.id]: '0xEA32A96608495e54156Ae48931A7c20f0dcc1a21', }, @@ -385,17 +475,18 @@ export const METISUSDC = new Token({ symbol: 'm.USDC', name: 'Metis USD Coin', swapableType: 'USD', - swapableOn: [CHAINS.METIS.id], color: 'blue', priorityRank: 125, routeSymbol: 'm.USDC', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/usdc.d5dcb030.svg', +} -export const USDT = new Token({ +export const USDT: BridgeableToken = { addresses: { - [CHAINS.ETH.id]: '0xdac17f958d2ee523a2206206994597c13d831ec7', + [CHAINS.ETHEREUM.id]: '0xdac17f958d2ee523a2206206994597c13d831ec7', [CHAINS.OPTIMISM.id]: '0x94b008aA00579c1307B0EF2c499aD98a8ce58e58', - [CHAINS.BNB.id]: '0x55d398326f99059ff775485246999027b3197955', + [CHAINS.BNBCHAIN.id]: '0x55d398326f99059ff775485246999027b3197955', [CHAINS.POLYGON.id]: '0xc2132d05d31c914a87c6611c10748aeb04b58e8f', [CHAINS.BOBA.id]: '0x5DE1677344D3Cb0D7D465c10b72A8f60699C062d', [CHAINS.DOGE.id]: '0x7f8e71DD5A7e445725F0EF94c7F01806299e877A', @@ -403,15 +494,12 @@ export const USDT = new Token({ [CHAINS.KLAYTN.id]: '0xd6dAb4CfF47dF175349e6e7eE2BF7c40Bb8C05A3', [CHAINS.ARBITRUM.id]: '0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9', [CHAINS.AVALANCHE.id]: '0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7', - }, - swapExceptions: { - [CHAINS.KLAYTN.id]: [CHAINS.ETH.id, CHAINS.DOGE.id], - [CHAINS.DOGE.id]: [CHAINS.ETH.id, CHAINS.DOGE.id], + [CHAINS.LINEA.id]: '0xA219439258ca9da29E9Cc4cE5596924745e12B93', }, decimals: { - [CHAINS.ETH.id]: 6, + [CHAINS.ETHEREUM.id]: 6, [CHAINS.OPTIMISM.id]: 6, - [CHAINS.BNB.id]: 18, + [CHAINS.BNBCHAIN.id]: 18, [CHAINS.POLYGON.id]: 6, [CHAINS.BOBA.id]: 6, [CHAINS.DOGE.id]: 6, @@ -419,30 +507,21 @@ export const USDT = new Token({ [CHAINS.KLAYTN.id]: 6, [CHAINS.ARBITRUM.id]: 6, [CHAINS.AVALANCHE.id]: 6, + [CHAINS.LINEA.id]: 6, }, symbol: 'USDT', name: 'USD Tether', color: 'lime', swapableType: 'USD', - swapableOn: [ - CHAINS.BNB.id, - CHAINS.ETH.id, - CHAINS.POLYGON.id, - CHAINS.ARBITRUM.id, - CHAINS.AVALANCHE.id, - CHAINS.HARMONY.id, - CHAINS.AURORA.id, - CHAINS.BOBA.id, - CHAINS.CANTO.id, - ], - visibilityRank: 100, - priorityRank: 101, + priorityRank: 100, routeSymbol: 'USDT', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/usdt.3c9cd2f8.svg', +} -export const DAI = new Token({ +export const DAI: BridgeableToken = { addresses: { - [CHAINS.ETH.id]: '0x6b175474e89094c44da98b954eedeac495271d0f', + [CHAINS.ETHEREUM.id]: '0x6b175474e89094c44da98b954eedeac495271d0f', [CHAINS.OPTIMISM.id]: '0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1', [CHAINS.POLYGON.id]: '0x8f3cf7ad23cd3cadbd9735aff958023239c6a063', [CHAINS.BOBA.id]: '0xf74195Bb8a5cf652411867c5C2C5b8C2a402be35', @@ -451,35 +530,34 @@ export const DAI = new Token({ [CHAINS.ARBITRUM.id]: '0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1', [CHAINS.BASE.id]: '0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb', }, - swapExceptions: { - [CHAINS.KLAYTN.id]: [CHAINS.ETH.id, CHAINS.DOGE.id], - [CHAINS.DOGE.id]: [CHAINS.ETH.id, CHAINS.DOGE.id], + decimals: { + [CHAINS.ETHEREUM.id]: 18, + [CHAINS.OPTIMISM.id]: 18, + [CHAINS.POLYGON.id]: 18, + [CHAINS.BOBA.id]: 18, + [CHAINS.DOGE.id]: 18, + [CHAINS.KLAYTN.id]: 18, + [CHAINS.ARBITRUM.id]: 18, + [CHAINS.BASE.id]: 18, }, - decimals: 18, symbol: 'DAI', name: 'Dai', swapableType: 'USD', - swapableOn: [ - CHAINS.ETH.id, - CHAINS.POLYGON.id, - CHAINS.AVALANCHE.id, - CHAINS.HARMONY.id, - CHAINS.BOBA.id, - ], color: 'yellow', - visibilityRank: 100, - priorityRank: 102, + priorityRank: 100, routeSymbol: 'DAI', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/dai.ba6d3142.svg', +} -export const WBTC = new Token({ +export const WBTC: BridgeableToken = { addresses: { - [CHAINS.ETH.id]: '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599', + [CHAINS.ETHEREUM.id]: '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599', [CHAINS.KLAYTN.id]: '0xDCbacF3f7a069922E677912998c8d57423C37dfA', [CHAINS.DOGE.id]: '0xD0c6179c43C00221915f1a61f8eC06A5Aa32F9EC', }, decimals: { - [CHAINS.ETH.id]: 8, + [CHAINS.ETHEREUM.id]: 8, [CHAINS.KLAYTN.id]: 8, [CHAINS.DOGE.id]: 8, }, @@ -489,40 +567,48 @@ export const WBTC = new Token({ color: 'orange', priorityRank: 300, routeSymbol: 'WBTC', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/wbtc.d5fa58cc.svg', +} -export const WETHE = new Token({ +export const WETHE: BridgeableToken = { addresses: { [CHAINS.AVALANCHE.id]: '0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab', }, - decimals: 18, + decimals: { + [CHAINS.AVALANCHE.id]: 18, + }, symbol: 'WETH.e', name: 'Wrapped ETH', swapableType: 'ETH', - swapableOn: [CHAINS.AVALANCHE.id], color: 'sky', priorityRank: 150, routeSymbol: 'WETH.e', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/weth.19fa93ab.svg', +} -export const ONEETH = new Token({ +export const ONEETH: BridgeableToken = { addresses: { [CHAINS.HARMONY.id]: '0x6983d1e6def3690c4d616b13597a09e6193ea013', }, - decimals: 18, + decimals: { + [CHAINS.HARMONY.id]: 18, + }, symbol: '1ETH', name: 'Harmony ETH', swapableType: 'ETH', - swapableOn: [CHAINS.HARMONY.id], color: 'sky', priorityRank: 600, routeSymbol: '1ETH', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/weth.19fa93ab.svg', +} -export const SYN = new Token({ +export const SYN: BridgeableToken = { addresses: { - [CHAINS.ETH.id]: '0x0f2d719407fdbeff09d87557abb7232601fd9f29', - [CHAINS.BNB.id]: '0xa4080f1778e69467e905b8d6f72f6e441f9e9484', + [CHAINS.ETHEREUM.id]: '0x0f2d719407fdbeff09d87557abb7232601fd9f29', + [CHAINS.BNBCHAIN.id]: '0xa4080f1778e69467e905b8d6f72f6e441f9e9484', [CHAINS.POLYGON.id]: '0xf8f9efc0db77d8881500bb06ff5d6abc3070e695', [CHAINS.FANTOM.id]: '0xE55e19Fb4F2D85af758950957714292DAC1e25B2', [CHAINS.ARBITRUM.id]: '0x080f6aed32fc474dd5717105dba5ea57268f46eb', @@ -538,55 +624,88 @@ export const SYN = new Token({ [CHAINS.DOGE.id]: '0xDfA53EeBA61D69E1D2b56b36d78449368F0265c1', [CHAINS.CANTO.id]: '0x555982d2E211745b96736665e19D9308B615F78e', [CHAINS.BASE.id]: '0x432036208d2717394d2614d6697c46DF3Ed69540', + [CHAINS.BLAST.id]: '0x9592f08387134e218327E6E8423400eb845EdE0E', + }, + decimals: { + [CHAINS.ETHEREUM.id]: 18, + [CHAINS.BNBCHAIN.id]: 18, + [CHAINS.POLYGON.id]: 18, + [CHAINS.FANTOM.id]: 18, + [CHAINS.ARBITRUM.id]: 18, + [CHAINS.AVALANCHE.id]: 18, + [CHAINS.HARMONY.id]: 18, + [CHAINS.BOBA.id]: 18, + [CHAINS.METIS.id]: 18, + [CHAINS.MOONRIVER.id]: 18, + [CHAINS.MOONBEAM.id]: 18, + [CHAINS.OPTIMISM.id]: 18, + [CHAINS.CRONOS.id]: 18, + [CHAINS.AURORA.id]: 18, + [CHAINS.DOGE.id]: 18, + [CHAINS.CANTO.id]: 18, + [CHAINS.BASE.id]: 18, + [CHAINS.BLAST.id]: 18, }, - decimals: 18, symbol: 'SYN', name: 'Synapse', swapableType: 'SYN', color: 'purple', - visibilityRank: 90, - priorityRank: 120, + priorityRank: 250, routeSymbol: 'SYN', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/syn.042f8cd0.svg', +} -export const FRAX = new Token({ +export const FRAX: BridgeableToken = { addresses: { - [CHAINS.ETH.id]: '0x853d955acef822db058eb8505911ed77f175b99e', + [CHAINS.ETHEREUM.id]: '0x853d955acef822db058eb8505911ed77f175b99e', [CHAINS.ARBITRUM.id]: '0x17FC002b466eEc40DaE837Fc4bE5c67993ddBd6F', [CHAINS.DOGE.id]: '0x10D70831f9C3c11c5fe683b2f1Be334503880DB6', - [CHAINS.POLYGON.id]: '0x45c32fA6DF82ead1e2EF74d17b76547EDdFaFF89', }, - decimals: 18, + decimals: { + [CHAINS.ETHEREUM.id]: 18, + [CHAINS.ARBITRUM.id]: 18, + [CHAINS.DOGE.id]: 18, + }, symbol: 'FRAX', name: 'Frax', swapableType: 'FRAX', color: 'gray', priorityRank: 200, routeSymbol: 'FRAX', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/frax.0f0670da.svg', +} -export const SYNFRAX = new Token({ +export const SYNFRAX: BridgeableToken = { addresses: { [CHAINS.FANTOM.id]: '0x1852F70512298d56e9c8FDd905e02581E04ddb2a', [CHAINS.MOONRIVER.id]: '0xE96AC70907ffF3Efee79f502C985A7A21Bce407d', [CHAINS.MOONBEAM.id]: '0xDd47A348AB60c61Ad6B60cA8C31ea5e00eBfAB4F', [CHAINS.HARMONY.id]: '0x1852F70512298d56e9c8FDd905e02581E04ddb2a', }, - decimals: 18, + decimals: { + [CHAINS.FANTOM.id]: 18, + [CHAINS.MOONRIVER.id]: 18, + [CHAINS.MOONBEAM.id]: 18, + [CHAINS.HARMONY.id]: 18, + }, symbol: 'synFRAX', name: 'Synapse Frax', swapableType: 'FRAX', color: 'gray', priorityRank: 400, routeSymbol: 'synFRAX', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/frax.0f0670da.svg', +} -export const NUSD = new Token({ +export const NUSD: BridgeableToken = { addresses: { - [CHAINS.ETH.id]: '0x1B84765dE8B7566e4cEAF4D0fD3c5aF52D3DdE4F', + [CHAINS.ETHEREUM.id]: '0x1B84765dE8B7566e4cEAF4D0fD3c5aF52D3DdE4F', [CHAINS.OPTIMISM.id]: '0x67C10C397dD0Ba417329543c1a40eb48AAa7cd00', [CHAINS.CRONOS.id]: '0x396c9c192dd323995346632581BEF92a31AC623b', - [CHAINS.BNB.id]: '0x23b891e5c62e0955ae2bd185990103928ab817b3', + [CHAINS.BNBCHAIN.id]: '0x23b891e5c62e0955ae2bd185990103928ab817b3', [CHAINS.POLYGON.id]: '0xb6c473756050de474286bed418b77aeac39b02af', [CHAINS.FANTOM.id]: '0xED2a7edd7413021d440b09D654f3b87712abAB66', [CHAINS.BOBA.id]: '0x6B4712AE9797C199edd44F897cA09BC57628a1CF', @@ -596,47 +715,52 @@ export const NUSD = new Token({ [CHAINS.AVALANCHE.id]: '0xCFc37A6AB183dd4aED08C204D1c2773c0b1BDf46', [CHAINS.HARMONY.id]: '0xED2a7edd7413021d440b09D654f3b87712abAB66', [CHAINS.AURORA.id]: '0x07379565cD8B0CaE7c60Dc78e7f601b34AF2A21c', + [CHAINS.BLAST.id]: '0x3194B0A295D87fDAA54DF852c248F7a6BAF6c6e0', + }, + decimals: { + [CHAINS.ETHEREUM.id]: 18, + [CHAINS.OPTIMISM.id]: 18, + [CHAINS.CRONOS.id]: 18, + [CHAINS.BNBCHAIN.id]: 18, + [CHAINS.POLYGON.id]: 18, + [CHAINS.FANTOM.id]: 18, + [CHAINS.BOBA.id]: 18, + [CHAINS.METIS.id]: 18, + [CHAINS.CANTO.id]: 18, + [CHAINS.ARBITRUM.id]: 18, + [CHAINS.AVALANCHE.id]: 18, + [CHAINS.HARMONY.id]: 18, + [CHAINS.AURORA.id]: 18, + [CHAINS.BLAST.id]: 18, }, - decimals: 18, symbol: 'nUSD', name: 'Synapse nUSD', swapableType: 'USD', - swapableOn: [ - CHAINS.BNB.id, - CHAINS.POLYGON.id, - CHAINS.FANTOM.id, - CHAINS.ARBITRUM.id, - CHAINS.AVALANCHE.id, - CHAINS.HARMONY.id, - CHAINS.AURORA.id, - CHAINS.BOBA.id, - CHAINS.OPTIMISM.id, - CHAINS.METIS.id, - CHAINS.CRONOS.id, - CHAINS.CANTO.id, - ], color: 'purple', - visibilityRank: 50, - priorityRank: 110, + priorityRank: 500, routeSymbol: 'nUSD', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/nusd.c7a22fdb.svg', +} -export const NOTE = new Token({ +export const NOTE: BridgeableToken = { addresses: { [CHAINS.CANTO.id]: '0x4e71a2e537b7f9d9413d3991d37958c0b5e1e503', }, - decimals: 18, + decimals: { + [CHAINS.CANTO.id]: 18, + }, symbol: 'NOTE', name: 'Canto Note', swapableType: 'USD', - swapableOn: [CHAINS.CANTO.id], color: 'green', - visibilityRank: 90, - priorityRank: 200, + priorityRank: 100, routeSymbol: 'NOTE', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/note.d5246fbd.svg', +} -export const NETH = new Token({ +export const NETH: BridgeableToken = { addresses: { [CHAINS.OPTIMISM.id]: '0x809DC529f07651bD43A172e8dB6f4a7a0d771036', [CHAINS.FANTOM.id]: '0x67C10C397dD0Ba417329543c1a40eb48AAa7cd00', @@ -647,210 +771,266 @@ export const NETH = new Token({ [CHAINS.ARBITRUM.id]: '0x3ea9B0ab55F34Fb188824Ee288CeaEfC63cf908e', [CHAINS.AVALANCHE.id]: '0x19E1ae0eE35c0404f835521146206595d37981ae', [CHAINS.HARMONY.id]: '0x0b5740c6b4a97f90eF2F0220651Cca420B868FfB', + [CHAINS.BLAST.id]: '0xce971282fAAc9faBcF121944956da7142cccC855', + }, + decimals: { + [CHAINS.OPTIMISM.id]: 18, + [CHAINS.FANTOM.id]: 18, + [CHAINS.BOBA.id]: 18, + [CHAINS.METIS.id]: 18, + [CHAINS.CANTO.id]: 18, + [CHAINS.BASE.id]: 18, + [CHAINS.ARBITRUM.id]: 18, + [CHAINS.AVALANCHE.id]: 18, + [CHAINS.HARMONY.id]: 18, + [CHAINS.BLAST.id]: 18, }, - decimals: 18, symbol: 'nETH', name: 'Synapse nETH', swapableType: 'ETH', - swapableOn: [ - CHAINS.OPTIMISM.id, - CHAINS.BOBA.id, - CHAINS.METIS.id, - CHAINS.CANTO.id, - CHAINS.BASE.id, - CHAINS.ARBITRUM.id, - CHAINS.AVALANCHE.id, - CHAINS.HARMONY.id, - ], color: 'purple', - visibilityRank: 50, - priorityRank: 115, + priorityRank: 500, routeSymbol: 'nETH', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/neth.7c854d0f.svg', +} -export const ETH = new Token({ +export const ETH: BridgeableToken = { addresses: { - [CHAINS.ETH.id]: zeroAddress, - [CHAINS.OPTIMISM.id]: zeroAddress, - [CHAINS.BOBA.id]: zeroAddress, + [CHAINS.ETHEREUM.id]: ZeroAddress, + [CHAINS.OPTIMISM.id]: ZeroAddress, + [CHAINS.BOBA.id]: ZeroAddress, [CHAINS.CANTO.id]: '0x5FD55A1B9FC24967C4dB09C513C3BA0DFa7FF687', - [CHAINS.BASE.id]: zeroAddress, - [CHAINS.ARBITRUM.id]: zeroAddress, + [CHAINS.BASE.id]: ZeroAddress, + [CHAINS.ARBITRUM.id]: ZeroAddress, [CHAINS.DFK.id]: '0xfBDF0E31808d0aa7b9509AA6aBC9754E48C58852', + [CHAINS.BLAST.id]: ZeroAddress, + [CHAINS.SCROLL.id]: ZeroAddress, + [CHAINS.LINEA.id]: ZeroAddress, + }, + decimals: { + [CHAINS.ETHEREUM.id]: 18, + [CHAINS.OPTIMISM.id]: 18, + [CHAINS.BOBA.id]: 18, + [CHAINS.CANTO.id]: 18, + [CHAINS.BASE.id]: 18, + [CHAINS.ARBITRUM.id]: 18, + [CHAINS.DFK.id]: 18, + [CHAINS.BLAST.id]: 18, + [CHAINS.SCROLL.id]: 18, + [CHAINS.LINEA.id]: 18, }, - decimals: 18, symbol: 'ETH', name: 'Ethereum', - isNative: true, swapableType: 'ETH', color: 'sky', - visibilityRank: 101, - priorityRank: 105, - swapableOn: [ - CHAINS.ARBITRUM.id, - CHAINS.BASE.id, - CHAINS.BOBA.id, - CHAINS.OPTIMISM.id, - ], + priorityRank: 150, routeSymbol: 'ETH', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/eth.b3692688.svg', +} -export const MOVR = new Token({ +export const MOVR: BridgeableToken = { addresses: { [CHAINS.MOONBEAM.id]: '0x1d4C2a246311bB9f827F4C768e277FF5787B7D7E', - [CHAINS.MOONRIVER.id]: zeroAddress, + [CHAINS.MOONRIVER.id]: ZeroAddress, + }, + decimals: { + [CHAINS.MOONBEAM.id]: 18, + [CHAINS.MOONRIVER.id]: 18, }, - decimals: 18, symbol: 'MOVR', name: 'MOVR', - isNative: true, swapableType: 'MOVR', color: 'purple', priorityRank: 300, routeSymbol: 'MOVR', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/movr.3fb35010.svg', +} -export const AVAX = new Token({ +export const AVAX: BridgeableToken = { addresses: { [CHAINS.MOONBEAM.id]: '0xA1f8890E39b4d8E33efe296D698fe42Fb5e59cC3', [CHAINS.KLAYTN.id]: '0xCd8fE44A29Db9159dB36f96570d7A4d91986f528', - [CHAINS.AVALANCHE.id]: zeroAddress, + [CHAINS.AVALANCHE.id]: ZeroAddress, [CHAINS.DFK.id]: '0xB57B60DeBDB0b8172bb6316a9164bd3C695F133a', [CHAINS.HARMONY.id]: '0xb12c13e66AdE1F72f71834f2FC5082Db8C091358', }, - decimals: 18, + decimals: { + [CHAINS.MOONBEAM.id]: 18, + [CHAINS.KLAYTN.id]: 18, + [CHAINS.AVALANCHE.id]: 18, + [CHAINS.DFK.id]: 18, + [CHAINS.HARMONY.id]: 18, + }, symbol: 'AVAX', name: 'AVAX', - isNative: true, swapableType: 'AVAX', color: 'red', - visibilityRank: 90, priorityRank: 300, routeSymbol: 'AVAX', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/avax.9d53cbf0.svg', +} -export const WMOVR = new Token({ +export const WMOVR: BridgeableToken = { addresses: { [CHAINS.MOONRIVER.id]: '0x98878b06940ae243284ca214f92bb71a2b032b8a', }, - decimals: 18, + decimals: { + [CHAINS.MOONRIVER.id]: 18, + }, symbol: 'MOVR', name: 'Wrapped MOVR', swapableType: 'MOVR', color: 'purple', priorityRank: 350, routeSymbol: 'WMOVR', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/movr.3fb35010.svg', +} -export const WAVAX = new Token({ +export const WAVAX: BridgeableToken = { addresses: { [CHAINS.AVALANCHE.id]: '0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7', }, - decimals: 18, + decimals: { + [CHAINS.AVALANCHE.id]: 18, + }, symbol: 'AVAX', name: 'Wrapped AVAX', swapableType: 'AVAX', color: 'red', - visibilityRank: 90, priorityRank: 350, routeSymbol: 'WAVAX', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/avax.9d53cbf0.svg', +} -export const JEWEL = new Token({ +export const JEWEL: BridgeableToken = { addresses: { - [CHAINS.DFK.id]: zeroAddress, + [CHAINS.DFK.id]: ZeroAddress, [CHAINS.HARMONY.id]: '0x72cb10c6bfa5624dd07ef608027e366bd690048f', [CHAINS.KLAYTN.id]: '0x30C103f8f5A3A732DFe2dCE1Cc9446f545527b43', [CHAINS.AVALANCHE.id]: '0x997Ddaa07d716995DE90577C123Db411584E5E46', + [CHAINS.METIS.id]: '0x17C09cfC96C865CF546d73365Cedb6dC66986963', + [CHAINS.ETHEREUM.id]: '0x12f79f8c1A6e47a9b5F0796FDb008Bdc182fa19e', + }, + decimals: { + [CHAINS.DFK.id]: 18, + [CHAINS.HARMONY.id]: 18, + [CHAINS.KLAYTN.id]: 18, + [CHAINS.AVALANCHE.id]: 18, + [CHAINS.METIS.id]: 18, + [CHAINS.ETHEREUM.id]: 18, }, - decimals: 18, symbol: 'JEWEL', name: 'JEWEL', color: 'lime', - isNative: true, swapableType: 'JEWEL', priorityRank: 250, routeSymbol: 'JEWEL', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/jewel.bb7c4136.svg', +} -export const WJEWEL = new Token({ +export const WJEWEL: BridgeableToken = { addresses: { [CHAINS.DFK.id]: '0xCCb93dABD71c8Dad03Fc4CE5559dC3D89F67a260', }, - decimals: 18, + decimals: { + [CHAINS.DFK.id]: 18, + }, symbol: 'WJEWEL', name: 'Wrapped JEWEL', swapableType: 'JEWEL', - swapableOn: [CHAINS.HARMONY.id], color: 'lime', priorityRank: 350, routeSymbol: 'WJEWEL', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/jewel.bb7c4136.svg', +} -export const SYNJEWEL = new Token({ +export const SYNJEWEL: BridgeableToken = { addresses: { [CHAINS.HARMONY.id]: '0x28b42698Caf46B4B012CF38b6C75867E0762186D', }, - decimals: 18, + decimals: { + [CHAINS.HARMONY.id]: 18, + }, symbol: 'synJEWEL', name: 'synJEWEL', swapableType: 'JEWEL', - swapableOn: [CHAINS.HARMONY.id], color: 'lime', priorityRank: 400, routeSymbol: 'synJEWEL', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/jewel.bb7c4136.svg', +} -export const XJEWEL = new Token({ +export const XJEWEL: BridgeableToken = { addresses: { [CHAINS.DFK.id]: '0x77f2656d04E158f915bC22f07B779D94c1DC47Ff', [CHAINS.HARMONY.id]: '0xA9cE83507D872C5e1273E745aBcfDa849DAA654F', }, - decimals: 18, + decimals: { + [CHAINS.DFK.id]: 18, + [CHAINS.HARMONY.id]: 18, + }, symbol: 'xJEWEL', name: 'xJEWEL', swapableType: 'XJEWEL', color: 'lime', priorityRank: 350, routeSymbol: 'xJEWEL', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/jewel.bb7c4136.svg', +} -export const USDCe = new Token({ +export const USDCe: BridgeableToken = { addresses: { [CHAINS.OPTIMISM.id]: '0x7F5c764cBc14f9669B88837ca1490cCa17c31607', [CHAINS.AVALANCHE.id]: '0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664', [CHAINS.ARBITRUM.id]: '0xff970a61a04b1ca14834a43f5de4533ebddb5cc8', [CHAINS.AURORA.id]: '0xB12BFcA5A55806AaF64E99521918A4bf0fC40802', - [CHAINS.POLYGON.id]: '0x2791bca1f2de4661ed88a30c99a7a9449aa84174', }, - decimals: 6, + decimals: { + [CHAINS.OPTIMISM.id]: 6, + [CHAINS.AVALANCHE.id]: 6, + [CHAINS.ARBITRUM.id]: 6, + [CHAINS.AURORA.id]: 6, + }, symbol: 'USDC.e', name: 'Bridged USDC', swapableType: 'USD', color: 'blue', - swapableOn: [CHAINS.AVALANCHE.id, CHAINS.ARBITRUM.id, CHAINS.OPTIMISM.id], - visibilityRank: 100, priorityRank: 125, routeSymbol: 'USDC.e', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/usdc.d5dcb030.svg', +} -export const USDTe = new Token({ +export const USDTe: BridgeableToken = { addresses: { [CHAINS.AVALANCHE.id]: '0xc7198437980c041c805a1edcba50c1ce5db95118', [CHAINS.AURORA.id]: '0x4988a896b1227218e4A686fdE5EabdcAbd91571f', }, - decimals: 6, + decimals: { + [CHAINS.AVALANCHE.id]: 6, + [CHAINS.AURORA.id]: 6, + }, symbol: 'USDT.e', name: 'Bridged USDT', swapableType: 'USD', - swapableOn: [CHAINS.AVALANCHE.id], - visibilityRank: 100, color: 'green', priorityRank: 125, routeSymbol: 'USDT.e', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/usdt.3c9cd2f8.svg', +} -export const SUSD = new Token({ +export const SUSD: BridgeableToken = { addresses: { [CHAINS.OPTIMISM.id]: '0x8c6f28f2F1A3C87F0f938b96d27520d9751ec8d9', }, @@ -861,20 +1041,20 @@ export const SUSD = new Token({ name: 'Synth sUSD', color: 'purple', swapableType: 'USD', - swapableOn: [CHAINS.OPTIMISM.id], - visibilityRank: 100, priorityRank: 200, routeSymbol: 'sUSD', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/susd.3aa0b6c4.svg', +} -export const WSOHM = new Token({ +export const WSOHM: BridgeableToken = { addresses: { - [CHAINS.ETH.id]: '0xCa76543Cf381ebBB277bE79574059e32108e3E65', + [CHAINS.ETHEREUM.id]: '0xCa76543Cf381ebBB277bE79574059e32108e3E65', [CHAINS.ARBITRUM.id]: '0x30bD4e574a15994B35EF9C7a5bc29002F1224821', [CHAINS.AVALANCHE.id]: '0x240E332Cd26AaE10622B24160D23425A17256F5d', }, decimals: { - [CHAINS.ETH.id]: 18, + [CHAINS.ETHEREUM.id]: 18, [CHAINS.ARBITRUM.id]: 18, [CHAINS.AVALANCHE.id]: 18, }, @@ -882,28 +1062,30 @@ export const WSOHM = new Token({ name: 'Wrapped sOHM', color: 'gray', swapableType: 'OHM', - visibilityRank: 40, priorityRank: 600, routeSymbol: 'wsOHM', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/ohm.1b779b45.svg', +} -export const ONEDAI = new Token({ +export const ONEDAI: BridgeableToken = { addresses: { [CHAINS.HARMONY.id]: '0xef977d2f931c1978db5f6747666fa1eacb0d0339', }, - decimals: 18, + decimals: { + [CHAINS.HARMONY.id]: 18, + }, symbol: '1DAI', name: 'Harmony Dai Stablecoin', swapableType: 'USD', - swapableOn: [CHAINS.HARMONY.id], color: 'yellow', - visibilityRank: 100, priorityRank: 600, routeSymbol: '1DAI', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/dai.ba6d3142.svg', +} -export const ONEUSDC = new Token({ - visibilityRank: 101, +export const ONEUSDC: BridgeableToken = { addresses: { [CHAINS.HARMONY.id]: '0x985458e523db3d53125813ed68c274899e9dfab4', }, @@ -913,13 +1095,14 @@ export const ONEUSDC = new Token({ symbol: '1USDC', name: 'Harmony USD Coin', swapableType: 'USD', - swapableOn: [CHAINS.HARMONY.id], color: 'blue', priorityRank: 600, routeSymbol: '1USDC', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/usdc.d5dcb030.svg', +} -export const ONEUSDT = new Token({ +export const ONEUSDT: BridgeableToken = { addresses: { [CHAINS.HARMONY.id]: '0x3c2b8be99c50593081eaa2a724f0b8285f5aba8f', }, @@ -930,13 +1113,13 @@ export const ONEUSDT = new Token({ name: 'Harmony USD Tether', color: 'lime', swapableType: 'USD', - swapableOn: [CHAINS.HARMONY.id], - visibilityRank: 100, priorityRank: 600, routeSymbol: '1USDT', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/usdt.3c9cd2f8.svg', +} -export const BTCB = new Token({ +export const BTCB: BridgeableToken = { addresses: { [CHAINS.KLAYTN.id]: '0xe82f87ba4E97b2796aA0Fa4eFB06e8f0d2EB4FE1', [CHAINS.AVALANCHE.id]: '0x152b9d0FdC40C096757F570A51E494bd4b943E50', @@ -953,26 +1136,30 @@ export const BTCB = new Token({ color: 'orange', priorityRank: 300, routeSymbol: 'BTC.b', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/btc.63077225.svg', +} -export const DAIE = new Token({ +export const DAIe: BridgeableToken = { addresses: { [CHAINS.AVALANCHE.id]: '0xd586E7F844cEa2F87f50152665BCbc2C279D8d70', }, - decimals: 18, + decimals: { + [CHAINS.AVALANCHE.id]: 18, + }, symbol: 'DAI.e', name: 'Dai.e Token', swapableType: 'USD', - swapableOn: [CHAINS.AVALANCHE.id], color: 'yellow', - visibilityRank: 100, priorityRank: 125, routeSymbol: 'DAI.e', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/dai.ba6d3142.svg', +} -export const KLAY = new Token({ +export const KLAY: BridgeableToken = { addresses: { - [CHAINS.KLAYTN.id]: zeroAddress, + [CHAINS.KLAYTN.id]: ZeroAddress, [CHAINS.DFK.id]: '0x97855Ba65aa7ed2F65Ed832a776537268158B78a', }, decimals: { @@ -981,14 +1168,15 @@ export const KLAY = new Token({ }, symbol: 'KLAY', name: 'Klaytn', - isNative: true, swapableType: 'KLAY', color: 'red', priorityRank: 300, routeSymbol: 'KLAY', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/klay.a50be928.svg', +} -export const WKLAY = new Token({ +export const WKLAY: BridgeableToken = { addresses: { [CHAINS.KLAYTN.id]: '0x5819b6af194A78511c79C85Ea68D2377a7e9335f', }, @@ -1001,70 +1189,85 @@ export const WKLAY = new Token({ color: 'red', priorityRank: 350, routeSymbol: 'WKLAY', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/klay.a50be928.svg', +} -export const MATIC = new Token({ +export const MATIC: BridgeableToken = { addresses: { - [CHAINS.POLYGON.id]: zeroAddress, + [CHAINS.POLYGON.id]: ZeroAddress, [CHAINS.DFK.id]: '0xD17a41Cd199edF1093A9Be4404EaDe52Ec19698e', }, - decimals: 18, + decimals: { + [CHAINS.POLYGON.id]: 18, + [CHAINS.DFK.id]: 18, + }, symbol: 'MATIC', name: 'MATIC', - isNative: true, swapableType: 'MATIC', color: 'blue', - visibilityRank: 90, priorityRank: 300, routeSymbol: 'MATIC', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/matic.237cd2b6.svg', +} -export const WMATIC = new Token({ +export const WMATIC: BridgeableToken = { addresses: { [CHAINS.POLYGON.id]: '0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270', }, - decimals: 18, + decimals: { + [CHAINS.POLYGON.id]: 18, + }, symbol: 'WMATIC', name: 'WMATIC', swapableType: 'MATIC', color: 'blue', - visibilityRank: 90, priorityRank: 350, routeSymbol: 'WMATIC', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/matic.237cd2b6.svg', +} -export const FTM = new Token({ +export const FTM: BridgeableToken = { addresses: { - [CHAINS.FANTOM.id]: zeroAddress, + [CHAINS.FANTOM.id]: ZeroAddress, [CHAINS.DFK.id]: '0x2Df041186C844F8a2e2b63F16145Bc6Ff7d23E25', }, - decimals: 18, + decimals: { + [CHAINS.FANTOM.id]: 18, + [CHAINS.DFK.id]: 18, + }, symbol: 'FTM', name: 'Fantom', swapableType: 'FTM', - swapableOn: [CHAINS.FANTOM.id], color: 'blue', priorityRank: 300, routeSymbol: 'FTM', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/ftm.af71a88f.svg', +} -export const WFTM = new Token({ +export const WFTM: BridgeableToken = { addresses: { [CHAINS.FANTOM.id]: '0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83', }, - decimals: 18, + decimals: { + [CHAINS.FANTOM.id]: 18, + }, symbol: 'WFTM', name: 'Wrapped Fantom', swapableType: 'FTM', - swapableOn: [CHAINS.FANTOM.id], color: 'blue', priorityRank: 350, routeSymbol: 'WFTM', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/ftm.af71a88f.svg', +} -export const WETH = new Token({ +export const WETH: BridgeableToken = { addresses: { - [CHAINS.ETH.id]: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', + [CHAINS.ETHEREUM.id]: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', [CHAINS.OPTIMISM.id]: '0x121ab82b49B2BC4c7901CA46B8277962b4350204', [CHAINS.BOBA.id]: '0xd203De32170130082896b4111eDF825a4774c18E', [CHAINS.METIS.id]: '0x420000000000000000000000000000000000000A', @@ -1073,63 +1276,116 @@ export const WETH = new Token({ [CHAINS.KLAYTN.id]: '0xCD6f29dC9Ca217d0973d3D21bF58eDd3CA871a86', [CHAINS.BASE.id]: '0x4200000000000000000000000000000000000006', [CHAINS.ARBITRUM.id]: '0x82af49447d8a07e3bd95bd0d56f35241523fbab1', + [CHAINS.BLAST.id]: '0x4300000000000000000000000000000000000004', + }, + decimals: { + [CHAINS.ETHEREUM.id]: 18, + [CHAINS.OPTIMISM.id]: 18, + [CHAINS.BOBA.id]: 18, + [CHAINS.METIS.id]: 18, + [CHAINS.MOONBEAM.id]: 18, + [CHAINS.DOGE.id]: 18, + [CHAINS.KLAYTN.id]: 18, + [CHAINS.BASE.id]: 18, + [CHAINS.ARBITRUM.id]: 18, + [CHAINS.BLAST.id]: 18, }, - decimals: 18, symbol: 'WETH', name: 'Wrapped ETH', swapableType: 'ETH', color: 'sky', priorityRank: 350, routeSymbol: 'WETH', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/weth.19fa93ab.svg', +} -export const CRVUSD = new Token({ - visibilityRank: 101, +export const CRVUSD: BridgeableToken = { addresses: { - [CHAINS.ETH.id]: '0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E', + [CHAINS.ETHEREUM.id]: '0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E', [CHAINS.BASE.id]: '0x417Ac0e078398C154EdFadD9Ef675d30Be60Af93', }, - decimals: 18, - swapExceptions: {}, + decimals: { + [CHAINS.ETHEREUM.id]: 18, + [CHAINS.BASE.id]: 18, + }, symbol: 'crvUSD', name: 'Curve.fi USD', swapableType: 'USD', - swapableOn: [], + color: 'yellow', priorityRank: 200, routeSymbol: 'crvUSD', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/crvusd.e65e6479.svg', +} -export const LUSD = new Token({ - visibilityRank: 101, +export const LUSD: BridgeableToken = { addresses: { - [CHAINS.ETH.id]: '0x5f98805A4E8be255a32880FDeC7F6728C6568bA0', + [CHAINS.ETHEREUM.id]: '0x5f98805A4E8be255a32880FDeC7F6728C6568bA0', + }, + decimals: { + [CHAINS.ETHEREUM.id]: 18, }, - decimals: 18, - swapExceptions: {}, symbol: 'LUSD', name: 'Liquity USD', swapableType: 'USD', - swapableOn: [], color: 'blue', priorityRank: 200, routeSymbol: 'LUSD', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/lusd.1d09460e.svg', +} -export const USDBC = new Token({ - visibilityRank: 101, +export const USDBC: BridgeableToken = { addresses: { [CHAINS.BASE.id]: '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA', }, decimals: { [CHAINS.BASE.id]: 6, }, - swapExceptions: {}, symbol: 'USDbC', name: 'USD Base Coin', swapableType: 'USD', - swapableOn: [], color: 'blue', priorityRank: 125, routeSymbol: 'USDbC', -}) + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/usdc.d5dcb030.svg', +} + +export const USDB: BridgeableToken = { + addresses: { + [CHAINS.BLAST.id]: '0x4300000000000000000000000000000000000003', + }, + decimals: { + [CHAINS.BLAST.id]: 18, + }, + symbol: 'USDB', + name: 'Blast Rebasing USD', + swapableType: 'USD', + color: 'yellow', + priorityRank: 103, + routeSymbol: 'USDB', + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/usdb.33190604.svg', +} + +export const SPECTRAL: BridgeableToken = { + priorityRank: 600, + addresses: { + [CHAINS.ETHEREUM.id]: '0xAdF7C35560035944e805D98fF17d58CDe2449389', + [CHAINS.BASE.id]: '0x96419929d7949D6A801A6909c145C8EEf6A40431', + }, + decimals: { + [CHAINS.ETHEREUM.id]: 18, + [CHAINS.BASE.id]: 18, + }, + symbol: 'SPEC', + name: 'Spectral Token', + swapableType: 'SPEC', + color: 'blue', + routeSymbol: 'SPEC', + imgUrl: + 'https://105bc697.sanguine-fe.pages.dev/_next/static/media/spectral.6d51750c.svg', +} diff --git a/packages/rest-api/src/constants/chains.ts b/packages/rest-api/src/constants/chains.ts new file mode 100644 index 0000000000..dcc4c2502b --- /dev/null +++ b/packages/rest-api/src/constants/chains.ts @@ -0,0 +1,495 @@ +import _ from 'lodash' + +import { Chain } from '../types' + +export const ETHEREUM: Chain = { + id: 1, + name: 'Ethereum', + rpcUrls: { + primary: 'https://ethereum.blockpi.network/v1/rpc/public', + fallback: 'https://rpc.ankr.com/eth', + }, + explorerUrl: 'https://etherscan.com', + explorerName: 'Etherscan', + blockTime: 12000, + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/ethereum.4a372106.svg', + networkName: 'Ethereum Mainnet', + networkUrl: 'https://eth.llamarpc.com', + nativeCurrency: { + name: 'Ethereum', + symbol: 'ETH', + decimals: 18, + }, +} + +export const ARBITRUM: Chain = { + id: 42161, + name: 'Arbitrum', + rpcUrls: { + primary: 'https://arbitrum.blockpi.network/v1/rpc/public', + fallback: 'https://arb1.arbitrum.io/rpc', + }, + explorerUrl: 'https://arbiscan.io', + explorerName: 'Arbiscan', + blockTime: 300, + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/arbitrum.8ddb1b22.svg', + networkName: 'Arbitrum One', + networkUrl: 'https://arb1.arbitrum.io/rpc', + nativeCurrency: { + name: 'Ethereum', + symbol: 'ETH', + decimals: 18, + }, +} + +export const BNBCHAIN: Chain = { + id: 56, + name: 'BNB Chain', + rpcUrls: { + primary: 'https://bsc-dataseed1.ninicoin.io/', + fallback: 'https://bsc-dataseed2.ninicoin.io', + }, + explorerUrl: 'https://bscscan.com', + explorerName: 'BscScan', + blockTime: 3000, + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/bnb.5948fe5e.svg', + networkName: 'BNB Smart Chain Mainnet', + networkUrl: 'https://bsc-dataseed1.bnbchain.org', + nativeCurrency: { + name: 'Binance Coin', + symbol: 'BNB', + decimals: 18, + }, +} + +export const AVALANCHE: Chain = { + id: 43114, + name: 'Avalanche', + rpcUrls: { + primary: 'https://api.avax.network/ext/bc/C/rpc', + fallback: 'https://1rpc.io/avax/c', + }, + explorerUrl: 'https://snowtrace.io/', + explorerName: 'Snowtrace', + blockTime: 2000, + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/avalanche.9d53cbf0.svg', + networkName: 'Avalanche C-Chain', + networkUrl: 'https://api.avax.network/ext/bc/C/rpc', + nativeCurrency: { + name: 'Avax', + symbol: 'AVAX', + decimals: 18, + }, +} + +export const CANTO: Chain = { + id: 7700, + name: 'Canto', + rpcUrls: { + primary: 'https://mainnode.plexnode.org:8545', + fallback: 'https://canto.slingshot.finance', + }, + explorerUrl: 'https://tuber.build/', + explorerName: 'Canto Explorer', + blockTime: 6000, + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/canto.cb85e14f.svg', + networkName: 'Canto', + networkUrl: 'https://canto.slingshot.finance', + nativeCurrency: { + name: 'Canto', + symbol: 'CANTO', + decimals: 18, + }, +} + +export const OPTIMISM: Chain = { + id: 10, + name: 'Optimism', + rpcUrls: { + primary: 'https://mainnet.optimism.io', + fallback: 'https://1rpc.io/op', + }, + explorerUrl: 'https://optimistic.etherscan.io', + explorerName: 'Optimism Explorer', + blockTime: 2000, + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/optimism.84d4f0ef.svg', + networkName: 'OP Mainnet', + networkUrl: 'https://mainnet.optimism.io', + nativeCurrency: { + name: 'Ethereum', + symbol: 'ETH', + decimals: 18, + }, +} + +export const POLYGON: Chain = { + id: 137, + name: 'Polygon', + rpcUrls: { + primary: 'https://polygon-bor.publicnode.com', + fallback: 'https://polygon.llamarpc.com', + }, + explorerUrl: 'https://polygonscan.com', + explorerName: 'PolygonScan', + blockTime: 2000, + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/polygon.237cd2b6.svg', + networkName: 'Polygon Mainnet', + networkUrl: 'https://polygon-rpc.com', + nativeCurrency: { + name: 'Matic', + symbol: 'MATIC', + decimals: 18, + }, +} + +export const DFK: Chain = { + id: 53935, + name: 'DFK Chain', + rpcUrls: { + primary: 'https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc', + fallback: 'https://dfkchain.api.onfinality.io/public', + }, + explorerUrl: 'https://subnets.avax.network/defi-kingdoms', + explorerName: 'DFK Subnet Explorer', + blockTime: 2000, + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/dfk.2bd1f0e4.svg', + networkName: 'DFK Chain', + networkUrl: 'https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc', + nativeCurrency: { + name: 'Jewel', + symbol: 'JEWEL', + decimals: 18, + }, +} + +export const KLAYTN: Chain = { + id: 8217, + name: 'Klaytn', + rpcUrls: { + primary: 'https://klaytn.blockpi.network/v1/rpc/public', + fallback: 'https://klaytn.api.onfinality.io/public', + }, + explorerUrl: 'https://scope.klaytn.com', + explorerName: 'Klaytn Explorer', + blockTime: 1000, + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/klaytn.59495fbb.svg', + networkName: 'Klaytn Mainnet Cypress', + networkUrl: 'https://public-en-cypress.klaytn.net', + nativeCurrency: { + name: 'Klaytn', + symbol: 'KLAY', + decimals: 18, + }, +} + +export const FANTOM: Chain = { + id: 250, + name: 'Fantom', + rpcUrls: { + primary: 'https://rpc.ftm.tools', + fallback: 'https://fantom-rpc.gateway.pokt.network/', + }, + explorerUrl: 'https://ftmscan.com', + explorerName: 'FTMScan', + blockTime: 1000, + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/fantom.1e444dad.svg', + networkName: 'Fantom Opera', + networkUrl: 'https://rpc.ftm.tools', + nativeCurrency: { + name: 'Fantom', + symbol: 'FTM', + decimals: 18, + }, +} + +export const CRONOS: Chain = { + id: 25, + name: 'Cronos', + rpcUrls: { + primary: 'https://evm-cronos.crypto.org', + fallback: 'https://cronos.blockpi.network/v1/rpc/public', + }, + explorerUrl: 'https://cronoscan.com', + explorerName: 'CronoScan', + blockTime: 6000, + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/cronos.b06f8311.svg', + networkName: 'Cronos Mainnet', + networkUrl: 'https://evm.cronos.org', + nativeCurrency: { + name: 'Cronos', + symbol: 'CRO', + decimals: 18, + }, +} + +export const BOBA: Chain = { + id: 288, + name: 'Boba Chain', + rpcUrls: { + primary: 'https://mainnet.boba.network', + fallback: 'https://replica.boba.network', + }, + explorerUrl: 'https://bobascan.com', + explorerName: 'Boba Explorer', + blockTime: 1000, + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/boba.2072e50b.svg', + networkName: 'Boba Network', + networkUrl: 'https://mainnet.boba.network', + nativeCurrency: { + name: 'Ethereum', + symbol: 'ETH', + decimals: 18, + }, +} + +export const METIS: Chain = { + id: 1088, + name: 'Metis', + rpcUrls: { + primary: 'https://andromeda.metis.io/?owner=1088', + fallback: 'https://metis-mainnet.public.blastapi.io', + }, + explorerUrl: 'https://andromeda-explorer.metis.io', + explorerName: 'Metis Explorer', + blockTime: 4000, + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/metis.3114f675.svg', + networkName: 'Metis Andromeda Mainnet', + networkUrl: 'https://andromeda.metis.io/?owner=1088', + nativeCurrency: { + name: 'Metis', + symbol: 'METIS', + decimals: 18, + }, +} + +export const AURORA: Chain = { + id: 1313161554, + name: 'Aurora', + rpcUrls: { + primary: 'https://mainnet.aurora.dev', + fallback: 'https://1rpc.io/aurora', + }, + explorerUrl: 'https://explorer.mainnet.aurora.dev', + explorerName: 'Aurora Explorer', + blockTime: 1000, + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/aurora.5a46037d.svg', + networkName: 'Aurora Mainnet', + networkUrl: 'https://mainnet.aurora.dev', + nativeCurrency: { + name: 'Ethereum', + symbol: 'ETH', + decimals: 18, + }, +} + +export const HARMONY: Chain = { + id: 1666600000, + name: 'Harmony', + rpcUrls: { + primary: 'https://api.harmony.one', + fallback: 'https://api.s0.t.hmny.io', + }, + explorerUrl: 'https://explorer.harmony.one', + explorerName: 'Harmony Explorer', + blockTime: 2000, + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/harmony.af12f77e.svg', + networkName: 'Harmony Mainnet Shard 0', + networkUrl: 'https://api.harmony.one', + nativeCurrency: { + name: 'Harmony One', + symbol: 'ONE', + decimals: 18, + }, +} + +export const MOONBEAM: Chain = { + id: 1284, + name: 'Moonbeam', + rpcUrls: { + primary: 'https://rpc.api.moonbeam.network', + fallback: 'https://moonbeam.public.blastapi.io', + }, + explorerUrl: 'https://moonbeam.moonscan.io', + explorerName: 'Moonbeam Explorer', + blockTime: 12000, + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/moonbeam.284ab9b4.svg', + networkName: 'Moonbeam', + networkUrl: 'https://rpc.api.moonbeam.network', + nativeCurrency: { + name: 'Glimmer', + symbol: 'GLMR', + decimals: 18, + }, +} + +export const MOONRIVER: Chain = { + id: 1285, + name: 'Moonriver', + rpcUrls: { + primary: 'https://rpc.api.moonriver.moonbeam.network', + fallback: 'https://moonriver.public.blastapi.io', + }, + explorerUrl: 'https://moonriver.moonscan.io', + explorerName: 'Moonriver Explorer', + blockTime: 12000, + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/moonriver.3fb35010.svg', + networkName: 'Moonriver', + networkUrl: 'https://rpc.api.moonriver.moonbeam.network', + nativeCurrency: { + name: 'Moonriver', + symbol: 'MOVR', + decimals: 18, + }, +} + +export const DOGE: Chain = { + id: 2000, + name: 'Dogechain', + rpcUrls: { + primary: 'https://rpc.dogechain.dog', + fallback: 'https://rpc01-sg.dogechain.dog', + }, + explorerUrl: 'https://explorer.dogechain.dog', + explorerName: 'Dogechain Explorer', + blockTime: 2000, + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/dogechain.36935650.svg', + networkName: 'Dogechain Mainnet', + networkUrl: 'https://rpc.dogechain.dog', + nativeCurrency: { + name: 'DOGE', + symbol: 'DOGE', + decimals: 18, + }, +} + +export const BASE: Chain = { + id: 8453, + name: 'Base', + rpcUrls: { + primary: 'https://base.blockpi.network/v1/rpc/public', + fallback: 'https://developer-access-mainnet.base.org', + }, + explorerUrl: 'https://basescan.org', + explorerName: 'BaseScan', + blockTime: 3000, + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/base.d919fbef.svg', + networkName: 'Base', + networkUrl: 'https://mainnet.base.org', + nativeCurrency: { + name: 'Ethereum', + symbol: 'ETH', + decimals: 18, + }, +} + +export const BLAST: Chain = { + id: 81457, + name: 'Blast', + rpcUrls: { + primary: + 'https://lingering-indulgent-replica.blast-mainnet.quiknode.pro/6667a8f4be701cb6549b415d567bc706fb2f13a8/', + fallback: 'https://blast.blockpi.network/v1/rpc/publicChain', + }, + explorerUrl: 'https://blastscan.io', + explorerName: 'Blastscan', + blockTime: 3000, + imgUrl: + 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/blast.e39807f8.svg', + networkName: 'Blast', + networkUrl: 'https://rpc.blast.io', + nativeCurrency: { + name: 'Ethereum', + symbol: 'ETH', + decimals: 18, + }, +} + +export const SCROLL: Chain = { + id: 534352, + name: 'Scroll', + rpcUrls: { + primary: 'https://rpc.scroll.io/', + fallback: 'https://scroll.blockpi.network/v1/rpc/public', + }, + explorerUrl: 'https://scrollscan.com', + explorerName: 'Scrollscan', + blockTime: 3000, + imgUrl: + 'https://fe-adds-scroll.sanguine-fe.pages.dev/_next/static/media/scroll.a805c122.svg', + networkName: 'Scroll', + networkUrl: 'https://rpc.scroll.io', + nativeCurrency: { + name: 'Ethereum', + symbol: 'ETH', + decimals: 18, + }, +} + +export const LINEA: Chain = { + id: 59144, + name: 'Linea', + rpcUrls: { + primary: 'https://rpc.linea.build', + fallback: 'https://linea.blockpi.network/v1/rpc/public', + }, + explorerUrl: 'https://lineascan.build', + explorerName: 'LineaScan', + blockTime: 3000, + imgUrl: + 'https://master.sanguine-fe.pages.dev/_next/static/media/linea.e476f2ad.svg', + networkName: 'Linea', + networkUrl: 'https://rpc.linea.build', + nativeCurrency: { + name: 'Ethereum', + symbol: 'ETH', + decimals: 18, + }, +} + +export const CHAINS = { + ETHEREUM, + ARBITRUM, + BNBCHAIN, + AVALANCHE, + CANTO, + OPTIMISM, + POLYGON, + DFK, + KLAYTN, + FANTOM, + CRONOS, + BOBA, + METIS, + AURORA, + HARMONY, + MOONBEAM, + MOONRIVER, + DOGE, + BASE, + BLAST, + SCROLL, + LINEA, +} + +export const CHAINS_ARRAY = Object.values(CHAINS) + +export const CHAINS_BY_ID = _.keyBy(CHAINS, 'id') diff --git a/packages/rest-api/src/types/index.d.ts b/packages/rest-api/src/types/index.d.ts new file mode 100644 index 0000000000..b33182b1fa --- /dev/null +++ b/packages/rest-api/src/types/index.d.ts @@ -0,0 +1,98 @@ +export interface BridgeableToken { + addresses: {} + decimals: {} + symbol: string + name: string + swapableType: string + color: string + priorityRank: number + routeSymbol: string + imgUrl: string +} + +export type CustomRpcs = { + [chainId: number]: string +} + +export interface Chain { + id: number + name: string + rpcUrls: { + primary: string + fallback: string + } + explorerUrl: string + explorerName: string + blockTime: number + imgUrl: string + networkName: string + networkUrl: string + nativeCurrency: { + name: string + symbol: string + decimals: number + } +} + +export declare const AGEUR: BridgeableToken +export declare const AVAX: BridgeableToken +export declare const BTCB: BridgeableToken +export declare const BUSD: BridgeableToken +export declare const CRVUSD: BridgeableToken +export declare const DAI: BridgeableToken +export declare const DAIe: BridgeableToken +export declare const DOG: BridgeableToken +export declare const ETH: BridgeableToken +export declare const FRAX: BridgeableToken +export declare const FTM: BridgeableToken +export declare const GMX: BridgeableToken +export declare const GOHM: BridgeableToken +export declare const H2O: BridgeableToken +export declare const HIGH: BridgeableToken +export declare const JEWEL: BridgeableToken +export declare const JUMP: BridgeableToken +export declare const KLAY: BridgeableToken +export declare const L2DAO: BridgeableToken +export declare const LINK: BridgeableToken +export declare const LUSD: BridgeableToken +export declare const MATIC: BridgeableToken +export declare const METISUSDC: BridgeableToken +export declare const MOVR: BridgeableToken +export declare const NETH: BridgeableToken +export declare const NEWO: BridgeableToken +export declare const NFD: BridgeableToken +export declare const NOTE: BridgeableToken +export declare const NUSD: BridgeableToken +export declare const ONEDAI: BridgeableToken +export declare const ONEETH: BridgeableToken +export declare const ONEUSDC: BridgeableToken +export declare const ONEUSDT: BridgeableToken +export declare const PEPE: BridgeableToken +export declare const PLS: BridgeableToken +export declare const SDT: BridgeableToken +export declare const SFI: BridgeableToken +export declare const SOLAR: BridgeableToken +export declare const SUSD: BridgeableToken +export declare const SYN: BridgeableToken +export declare const SYNFRAX: BridgeableToken +export declare const SYNJEWEL: BridgeableToken +export declare const SPECTRAL: BridgeableToken +export declare const UNIDX: BridgeableToken +export declare const USDB: BridgeableToken +export declare const USDBC: BridgeableToken +export declare const USDC: BridgeableToken +export declare const USDCe: BridgeableToken +export declare const USDT: BridgeableToken +export declare const USDTe: BridgeableToken +export declare const VSTA: BridgeableToken +export declare const WAVAX: BridgeableToken +export declare const WBTC: BridgeableToken +export declare const WETH: BridgeableToken +export declare const WETHE: BridgeableToken +export declare const WFTM: BridgeableToken +export declare const WJEWEL: BridgeableToken +export declare const WKLAY: BridgeableToken +export declare const WMATIC: BridgeableToken +export declare const WMOVR: BridgeableToken +export declare const WSOHM: BridgeableToken +export declare const XJEWEL: BridgeableToken diff --git a/packages/rest-api/tsconfig.json b/packages/rest-api/tsconfig.json index e8e32f24b7..7fcbd74c35 100644 --- a/packages/rest-api/tsconfig.json +++ b/packages/rest-api/tsconfig.json @@ -1,7 +1,7 @@ { - // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs "include": [ - "./src/**/*" + "./src/**/*", + "./src/config/**/*" ], "compilerOptions": { "target": "esnext", @@ -11,31 +11,21 @@ "dom.iterable", "esnext" ], - "outDir": "./dist", + "outDir": "./dist", // Transpiled files will be output to the 'dist' folder "importHelpers": true, - // output .d.ts declaration files for consumers "declaration": true, - // output .js.map sourcemap files for consumers "sourceMap": true, - // match output dir to input dir. e.g. dist/index instead of dist/src/index "rootDir": "./src", - // stricter type-checking for stronger correctness. Recommended by TS "strict": false, // linter checks for common issues "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, - // noUnused* overlap with @typescript-eslint/no-unused-vars, can disable if duplicative "noUnusedLocals": true, "noUnusedParameters": true, - // use Node's module resolution algorithm, instead of the legacy TS one "moduleResolution": "node", - // transpile JSX to React.createElement "jsx": "react", - // interop between ESM and CJS modules. Recommended by TS "esModuleInterop": true, - // significant perf increase by skipping checking .d.ts files, particularly those in node_modules. Recommended by TS "skipLibCheck": true, - // error out if import and file system have a casing mismatch. Recommended by TS "forceConsistentCasingInFileNames": true, "resolveJsonModule": true, "allowSyntheticDefaultImports": true, diff --git a/packages/sdk-router/CHANGELOG.md b/packages/sdk-router/CHANGELOG.md index 5559fca4bf..ecd05f5fd7 100644 --- a/packages/sdk-router/CHANGELOG.md +++ b/packages/sdk-router/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.11.0](https://github.com/synapsecns/sanguine/compare/@synapsecns/sdk-router@0.10.0...@synapsecns/sdk-router@0.11.0) (2024-08-26) + + +### Features + +* **sdk:** uuid `BridgeQuote.id` ([#2896](https://github.com/synapsecns/sanguine/issues/2896)) ([85b5f53](https://github.com/synapsecns/sanguine/commit/85b5f538034a47f513d434aac2e55979bdbe390c)) + + + + + # [0.10.0](https://github.com/synapsecns/sanguine/compare/@synapsecns/sdk-router@0.9.0...@synapsecns/sdk-router@0.10.0) (2024-08-05) diff --git a/packages/sdk-router/jest.config.js b/packages/sdk-router/jest.config.js index 5486a1d920..3d04362457 100644 --- a/packages/sdk-router/jest.config.js +++ b/packages/sdk-router/jest.config.js @@ -1,4 +1,12 @@ module.exports = { maxConcurrency: 1, testTimeout: 30000, + moduleNameMapper: { + /** + * Force module uuidv7 to resolve with the CJS entry point, + * because Jest does not support package.json.exports. + * See https://github.com/uuidjs/uuid/issues/451 + */ + uuidv7: require.resolve('uuidv7'), + }, } diff --git a/packages/sdk-router/package.json b/packages/sdk-router/package.json index 4707d471e5..93e444eb5b 100644 --- a/packages/sdk-router/package.json +++ b/packages/sdk-router/package.json @@ -1,7 +1,7 @@ { "name": "@synapsecns/sdk-router", "description": "An SDK for interacting with the Synapse Protocol", - "version": "0.10.0", + "version": "0.11.0", "license": "MIT", "main": "dist/index.js", "typings": "dist/index.d.ts", @@ -60,6 +60,7 @@ }, "dependencies": { "@babel/core": "^7.20.12", + "@babel/plugin-transform-modules-commonjs": "^7.24.8", "@ethersproject/abi": "^5.7.0", "@ethersproject/abstract-provider": "^5.7.0", "@ethersproject/address": "^5.7.0", @@ -67,14 +68,16 @@ "@ethersproject/bytes": "^5.7.0", "@ethersproject/constants": "^5.7.0", "@ethersproject/contracts": "^5.7.0", - "babel-jest": "^29.4.1", + "babel-jest": "^25.2.6", "big.js": "^5.2.2", "decimal.js-light": "^2.5.1", "ethers": "^5.7.2", + "jest": "^29.7.0", "jsbi": "^4.3.0", "node-cache": "^5.1.2", "tiny-invariant": "^1.2.0", "toformat": "^2.0.0", - "ts-xor": "^1.1.0" + "ts-xor": "^1.1.0", + "uuidv7": "^1.0.1" } } diff --git a/packages/sdk-router/src/module/synapseModuleSet.ts b/packages/sdk-router/src/module/synapseModuleSet.ts index 1b4f92e230..723b7998ee 100644 --- a/packages/sdk-router/src/module/synapseModuleSet.ts +++ b/packages/sdk-router/src/module/synapseModuleSet.ts @@ -1,4 +1,5 @@ import { BigNumber } from '@ethersproject/bignumber' +import { uuidv7 } from 'uuidv7' import invariant from 'tiny-invariant' import { BigintIsh } from '../constants' @@ -201,6 +202,7 @@ export abstract class SynapseModuleSet { bridgeRoute.bridgeModuleName === this.bridgeModuleName, 'Invalid bridge module name' ) + const uuid = uuidv7() const { originQuery, destQuery } = bridgeRoute const { originModuleDeadline, destModuleDeadline } = this.getModuleDeadlines(originDeadline, destDeadline) @@ -208,6 +210,7 @@ export abstract class SynapseModuleSet { destQuery.deadline = destModuleDeadline const { feeAmount, feeConfig } = await this.getFeeData(bridgeRoute) return { + id: uuid, feeAmount, feeConfig, routerAddress: originModule.address, diff --git a/packages/sdk-router/src/module/types.ts b/packages/sdk-router/src/module/types.ts index 07fecbba9c..3a988a5185 100644 --- a/packages/sdk-router/src/module/types.ts +++ b/packages/sdk-router/src/module/types.ts @@ -55,6 +55,7 @@ export type SwapQuote = { * Returned by SDK to the consumer. */ export type BridgeQuote = { + id: string feeAmount: BigNumber feeConfig: FeeConfig routerAddress: string diff --git a/packages/sdk-router/src/sdk.test.ts b/packages/sdk-router/src/sdk.test.ts index 6574bc692e..4d49d9da45 100644 --- a/packages/sdk-router/src/sdk.test.ts +++ b/packages/sdk-router/src/sdk.test.ts @@ -101,6 +101,10 @@ const createBridgeQuoteTests = ( result = await resultPromise }) + it('Generates a bridge quote with valid uuid', async () => { + expect(typeof result.id).toBe('string') + }) + it('Fetches a bridge quote', async () => { expectCorrectBridgeQuote(result) }) @@ -402,6 +406,14 @@ describe('SynapseSDK', () => { amount ) + const secondResultPromise: Promise = synapse.bridgeQuote( + SupportedChainId.ARBITRUM, + SupportedChainId.ETH, + ARB_USDC, + ETH_USDC, + amount + ) + createBridgeQuoteTests( synapse, SupportedChainId.ARBITRUM, @@ -429,6 +441,13 @@ describe('SynapseSDK', () => { expect(result.originChainId).toEqual(SupportedChainId.ARBITRUM) expect(result.destChainId).toEqual(SupportedChainId.ETH) }) + + it('Fetches a second Synapse bridge quote with a different ID', async () => { + const firstQuote = await resultPromise + const secondQuote = await secondResultPromise + + expect(firstQuote.id).not.toEqual(secondQuote.id) + }) }) describe('ARB USDC -> ETH USDC (using CCTP)', () => { @@ -807,6 +826,17 @@ describe('SynapseSDK', () => { expect(allQuotes[1].destChainId).toEqual(SupportedChainId.ARBITRUM) }) + it('Generates unique IDs for SynapseBridge and SynapseCCTP quotes for USDC', async () => { + const allQuotes = await synapse.allBridgeQuotes( + SupportedChainId.ETH, + SupportedChainId.ARBITRUM, + ETH_USDC, + ARB_USDT, + BigNumber.from(10).pow(9) + ) + expect(allQuotes[0].id).not.toEqual(allQuotes[1].id) + }) + it('Fetches only SynapseBridge quotes for ETH', async () => { const allQuotes = await synapse.allBridgeQuotes( SupportedChainId.ETH, diff --git a/packages/synapse-interface/CHANGELOG.md b/packages/synapse-interface/CHANGELOG.md index 17cd70602f..47559bf8bb 100644 --- a/packages/synapse-interface/CHANGELOG.md +++ b/packages/synapse-interface/CHANGELOG.md @@ -3,6 +3,98 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.37.0](https://github.com/synapsecns/sanguine/compare/@synapsecns/synapse-interface@0.36.3...@synapsecns/synapse-interface@0.37.0) (2024-08-29) + + +### Features + +* **synapse-interface:** bridge quote uuid ([#2900](https://github.com/synapsecns/sanguine/issues/2900)) ([b568cbe](https://github.com/synapsecns/sanguine/commit/b568cbe423e2c19297c7ac4aeb239c61840afb0c)) + + + + + +## [0.36.3](https://github.com/synapsecns/sanguine/compare/@synapsecns/synapse-interface@0.36.2...@synapsecns/synapse-interface@0.36.3) (2024-08-27) + +**Note:** Version bump only for package @synapsecns/synapse-interface + + + + + +## [0.36.2](https://github.com/synapsecns/sanguine/compare/@synapsecns/synapse-interface@0.36.1...@synapsecns/synapse-interface@0.36.2) (2024-08-27) + +**Note:** Version bump only for package @synapsecns/synapse-interface + + + + + +## [0.36.1](https://github.com/synapsecns/sanguine/compare/@synapsecns/synapse-interface@0.36.0...@synapsecns/synapse-interface@0.36.1) (2024-08-26) + +**Note:** Version bump only for package @synapsecns/synapse-interface + + + + + +# [0.36.0](https://github.com/synapsecns/sanguine/compare/@synapsecns/synapse-interface@0.35.1...@synapsecns/synapse-interface@0.36.0) (2024-08-26) + + +### Features + +* **synapse-interface:** bridge quote state validations ([#3019](https://github.com/synapsecns/sanguine/issues/3019)) ([649b3f5](https://github.com/synapsecns/sanguine/commit/649b3f597787a3f81d98fdf64adf81bad851a45d)), closes [#3018](https://github.com/synapsecns/sanguine/issues/3018) + + + + + +## [0.35.1](https://github.com/synapsecns/sanguine/compare/@synapsecns/synapse-interface@0.35.0...@synapsecns/synapse-interface@0.35.1) (2024-08-25) + +**Note:** Version bump only for package @synapsecns/synapse-interface + + + + + +# [0.35.0](https://github.com/synapsecns/sanguine/compare/@synapsecns/synapse-interface@0.34.7...@synapsecns/synapse-interface@0.35.0) (2024-08-21) + + +### Features + +* **synapse-interface:** METIS token ([#3044](https://github.com/synapsecns/sanguine/issues/3044)) ([d73373b](https://github.com/synapsecns/sanguine/commit/d73373b93395fbe09064671c39ec774ca521330f)) + + + + + +## [0.34.7](https://github.com/synapsecns/sanguine/compare/@synapsecns/synapse-interface@0.34.6...@synapsecns/synapse-interface@0.34.7) (2024-08-19) + +**Note:** Version bump only for package @synapsecns/synapse-interface + + + + + +## [0.34.6](https://github.com/synapsecns/sanguine/compare/@synapsecns/synapse-interface@0.34.5...@synapsecns/synapse-interface@0.34.6) (2024-08-16) + + +### Bug Fixes + +* **synapse-interface:** hide Blast WETH ([#3033](https://github.com/synapsecns/sanguine/issues/3033)) ([8da405f](https://github.com/synapsecns/sanguine/commit/8da405f81183817f6564e859914d2dc02a49735f)) + + + + + +## [0.34.5](https://github.com/synapsecns/sanguine/compare/@synapsecns/synapse-interface@0.34.4...@synapsecns/synapse-interface@0.34.5) (2024-08-15) + +**Note:** Version bump only for package @synapsecns/synapse-interface + + + + + ## [0.34.4](https://github.com/synapsecns/sanguine/compare/@synapsecns/synapse-interface@0.34.3...@synapsecns/synapse-interface@0.34.4) (2024-08-14) diff --git a/packages/synapse-interface/assets/chains/metis.svg b/packages/synapse-interface/assets/chains/metis.svg index fd1342a2c0..f1e57e2078 100644 --- a/packages/synapse-interface/assets/chains/metis.svg +++ b/packages/synapse-interface/assets/chains/metis.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/packages/synapse-interface/assets/icons/metis.svg b/packages/synapse-interface/assets/icons/metis.svg new file mode 100644 index 0000000000..f1e57e2078 --- /dev/null +++ b/packages/synapse-interface/assets/icons/metis.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/synapse-interface/components/Maintenance/Maintenance.tsx b/packages/synapse-interface/components/Maintenance/Maintenance.tsx index 5b64ed4e7a..d6e2858089 100644 --- a/packages/synapse-interface/components/Maintenance/Maintenance.tsx +++ b/packages/synapse-interface/components/Maintenance/Maintenance.tsx @@ -26,7 +26,7 @@ interface ChainPause { disableCountdown: boolean } -interface BridgeModulePause { +export interface BridgeModulePause { chainId?: number // If undefined, pause bridge module for all chains. bridgeModuleName: 'SynapseBridge' | 'SynapseRFQ' | 'SynapseCCTP' | 'ALL' } diff --git a/packages/synapse-interface/components/Maintenance/components/EventCountdownProgressBar.tsx b/packages/synapse-interface/components/Maintenance/components/EventCountdownProgressBar.tsx index da75597604..42055a8707 100644 --- a/packages/synapse-interface/components/Maintenance/components/EventCountdownProgressBar.tsx +++ b/packages/synapse-interface/components/Maintenance/components/EventCountdownProgressBar.tsx @@ -22,13 +22,20 @@ export const useEventCountdownProgressBar = ( } => { let status: 'idle' | 'pending' | 'complete' - const { totalTimeRemainingInMinutes, hoursRemaining, isComplete, isPending } = - getCountdownTimeStatus(startDate, endDate) + const { + totalTimeRemainingInMinutes, + daysRemaining, + hoursRemaining, + isComplete, + isPending, + } = getCountdownTimeStatus(startDate, endDate) useIntervalTimer(60000, isComplete) const timeRemaining: string = - totalTimeRemainingInMinutes > 90 + daysRemaining > 0 + ? `${daysRemaining}d` + : totalTimeRemainingInMinutes > 90 ? `${hoursRemaining}h` : `${totalTimeRemainingInMinutes}m` diff --git a/packages/synapse-interface/components/StateManagedBridge/BridgeExchangeRateInfo.tsx b/packages/synapse-interface/components/StateManagedBridge/BridgeExchangeRateInfo.tsx index 11283e8b62..9524d59225 100644 --- a/packages/synapse-interface/components/StateManagedBridge/BridgeExchangeRateInfo.tsx +++ b/packages/synapse-interface/components/StateManagedBridge/BridgeExchangeRateInfo.tsx @@ -8,6 +8,7 @@ import { getValidAddress, isValidAddress } from '@/utils/isValidAddress' import { EMPTY_BRIDGE_QUOTE } from '@/constants/bridge' import { CHAINS_BY_ID } from '@constants/chains' import * as CHAINS from '@constants/chains/master' +import { useBridgeQuoteState } from '@/slices/bridgeQuote/hooks' export const BridgeExchangeRateInfo = () => { /* TODO: @@ -55,13 +56,14 @@ const DestinationAddress = () => { } const Slippage = () => { + const { debouncedFromValue } = useBridgeState() + const { - fromValue, bridgeQuote: { exchangeRate }, - } = useBridgeState() + } = useBridgeQuoteState() const { formattedPercentSlippage, safeFromAmount, underFee, textColor } = - useExchangeRateInfo(fromValue, exchangeRate) + useExchangeRateInfo(debouncedFromValue, exchangeRate) return (
    Slippage @@ -77,7 +79,7 @@ const Slippage = () => { const Router = () => { const { bridgeQuote: { bridgeModuleName }, - } = useBridgeState() + } = useBridgeQuoteState() return (
    Router @@ -87,7 +89,8 @@ const Router = () => { } const TimeEstimate = () => { - const { fromToken, bridgeQuote } = useBridgeState() + const { fromToken } = useBridgeState() + const { bridgeQuote } = useBridgeQuoteState() let showText let showTime @@ -125,10 +128,10 @@ const TimeEstimate = () => { const GasDropLabel = () => { let decimalsToDisplay + const { toChainId } = useBridgeState() const { bridgeQuote: { gasDropAmount }, - toChainId, - } = useBridgeState() + } = useBridgeQuoteState() const symbol = CHAINS_BY_ID[toChainId]?.nativeCurrency.symbol if ([CHAINS.FANTOM.id].includes(toChainId)) { @@ -166,9 +169,9 @@ const GasDropLabel = () => { ) } -const useExchangeRateInfo = (fromValue, exchangeRate) => { +const useExchangeRateInfo = (value, exchangeRate) => { const safeExchangeRate = typeof exchangeRate === 'bigint' ? exchangeRate : 0n - const safeFromAmount = fromValue ?? '0' + const safeFromAmount = value ?? '0' const formattedExchangeRate = formatBigIntToString(safeExchangeRate, 18, 4) const numExchangeRate = Number(formattedExchangeRate) diff --git a/packages/synapse-interface/components/StateManagedBridge/BridgeTransactionButton.tsx b/packages/synapse-interface/components/StateManagedBridge/BridgeTransactionButton.tsx index 9e76fc286b..0bde7cc3ae 100644 --- a/packages/synapse-interface/components/StateManagedBridge/BridgeTransactionButton.tsx +++ b/packages/synapse-interface/components/StateManagedBridge/BridgeTransactionButton.tsx @@ -1,29 +1,29 @@ -import { useMemo } from 'react' -import { TransactionButton } from '@/components/buttons/TransactionButton' -import { EMPTY_BRIDGE_QUOTE, EMPTY_BRIDGE_QUOTE_ZERO } from '@/constants/bridge' -import { useAccount, useAccountEffect, useSwitchChain } from 'wagmi' -import { useEffect, useState } from 'react' import { isAddress } from 'viem' - +import { useEffect, useState } from 'react' +import { useAccount, useAccountEffect, useSwitchChain } from 'wagmi' import { useConnectModal } from '@rainbow-me/rainbowkit' -import { stringToBigInt } from '@/utils/bigint/format' -import { useBridgeDisplayState, useBridgeState } from '@/slices/bridge/hooks' -import { usePortfolioBalances } from '@/slices/portfolio/hooks' + import { useAppDispatch } from '@/store/hooks' -import { setIsDestinationWarningAccepted } from '@/slices/bridgeDisplaySlice' import { useWalletState } from '@/slices/wallet/hooks' +import { useBridgeQuoteState } from '@/slices/bridgeQuote/hooks' +import { setIsDestinationWarningAccepted } from '@/slices/bridgeDisplaySlice' +import { useBridgeDisplayState, useBridgeState } from '@/slices/bridge/hooks' +import { TransactionButton } from '@/components/buttons/TransactionButton' +import { useBridgeValidations } from './hooks/useBridgeValidations' +import { segmentAnalyticsEvent } from '@/contexts/SegmentAnalyticsProvider' export const BridgeTransactionButton = ({ approveTxn, executeBridge, isApproved, isBridgePaused, + isTyping, }) => { const dispatch = useAppDispatch() - const [isConnected, setIsConnected] = useState(false) const { openConnectModal } = useConnectModal() + const [isConnected, setIsConnected] = useState(false) - const { chain, isConnected: isConnectedInit } = useAccount() + const { isConnected: isConnectedInit } = useAccount() const { chains, switchChain } = useSwitchChain() useAccountEffect({ @@ -39,63 +39,38 @@ export const BridgeTransactionButton = ({ const { destinationAddress, fromToken, - fromValue, - toToken, fromChainId, + toToken, toChainId, - isLoading, - bridgeQuote, + debouncedFromValue, } = useBridgeState() + const { bridgeQuote, isLoading } = useBridgeQuoteState() const { isWalletPending } = useWalletState() const { showDestinationWarning, isDestinationWarningAccepted } = useBridgeDisplayState() - const balances = usePortfolioBalances() - const balancesForChain = balances[fromChainId] - const balanceForToken = balancesForChain?.find( - (t) => t.tokenAddress === fromToken?.addresses[fromChainId] - )?.balance - - const sufficientBalance = useMemo(() => { - if (!fromChainId || !fromToken || !toChainId || !toToken) return false - return ( - stringToBigInt(fromValue, fromToken?.decimals[fromChainId]) <= - balanceForToken - ) - }, [balanceForToken, fromValue, fromChainId, toChainId, toToken]) - - const fromTokenDecimals: number | undefined = - fromToken && fromToken?.decimals[fromChainId] - - const fromValueBigInt = useMemo(() => { - return fromTokenDecimals ? stringToBigInt(fromValue, fromTokenDecimals) : 0 - }, [fromValue, fromTokenDecimals]) - - const bridgeQuoteAmountGreaterThanInputForRfq = useMemo(() => { - return ( - bridgeQuote.bridgeModuleName === 'SynapseRFQ' && - bridgeQuote.outputAmount > fromValueBigInt - ) - }, [bridgeQuote.outputAmount, fromValueBigInt]) - - const chainSelectionsMatchBridgeQuote = useMemo(() => { - return ( - fromChainId === bridgeQuote.originChainId && - toChainId === bridgeQuote.destChainId - ) - }, [fromChainId, toChainId, bridgeQuote]) + const { + hasValidInput, + hasValidQuote, + hasSufficientBalance, + doesBridgeStateMatchQuote, + isBridgeFeeGreaterThanInput, + isBridgeQuoteAmountGreaterThanInputForRfq, + onSelectedChain, + } = useBridgeValidations() const isButtonDisabled = + isBridgePaused || + isTyping || isLoading || isWalletPending || - bridgeQuote === EMPTY_BRIDGE_QUOTE_ZERO || - bridgeQuote === EMPTY_BRIDGE_QUOTE || - (destinationAddress && !isAddress(destinationAddress)) || - (isConnected && !sufficientBalance) || - bridgeQuoteAmountGreaterThanInputForRfq || - !chainSelectionsMatchBridgeQuote || - isBridgePaused + !hasValidInput || + !doesBridgeStateMatchQuote || + isBridgeQuoteAmountGreaterThanInputForRfq || + (isConnected && !hasValidQuote) || + (isConnected && !hasSufficientBalance) || + (destinationAddress && !isAddress(destinationAddress)) let buttonProperties @@ -122,41 +97,51 @@ export const BridgeTransactionButton = ({ } else if (isLoading) { buttonProperties = { label: `Bridge ${fromToken?.symbol}`, + pendingLabel: `Bridge ${fromToken?.symbol}`, onClick: null, } - } else if ( - !isLoading && - bridgeQuote?.feeAmount === 0n && - fromValueBigInt > 0 - ) { + } else if (!isConnected && hasValidInput) { + buttonProperties = { + label: `Connect Wallet to Bridge`, + onClick: openConnectModal, + } + } else if (!isLoading && isBridgeFeeGreaterThanInput && hasValidInput) { buttonProperties = { label: `Amount must be greater than fee`, onClick: null, } } else if ( + bridgeQuote.bridgeModuleName !== null && !isLoading && - !chainSelectionsMatchBridgeQuote && - fromValueBigInt > 0 + !isTyping && + !doesBridgeStateMatchQuote && + hasValidInput ) { buttonProperties = { - label: 'Please reset chain selection', + label: 'Error in bridge quote', onClick: null, } + + segmentAnalyticsEvent(`[Bridge] error: state out of sync with quote`, { + inputAmountForState: debouncedFromValue, + originChainIdForState: fromChainId, + originTokenForState: fromToken.symbol, + originTokenAddressForState: fromToken.addresses[fromChainId], + destinationChainIdForState: toChainId, + destinationTokenForState: toToken.symbol, + destinationTokenAddressForState: toToken.addresses[toChainId], + bridgeQuote, + }) } else if ( !isLoading && - bridgeQuoteAmountGreaterThanInputForRfq && - fromValueBigInt > 0 + isBridgeQuoteAmountGreaterThanInputForRfq && + hasValidInput ) { buttonProperties = { label: 'Invalid bridge quote', onClick: null, } - } else if (!isConnected && fromValueBigInt > 0) { - buttonProperties = { - label: `Connect Wallet to Bridge`, - onClick: openConnectModal, - } - } else if (!isLoading && isConnected && !sufficientBalance) { + } else if (!isLoading && isConnected && !hasSufficientBalance) { buttonProperties = { label: 'Insufficient balance', onClick: null, @@ -171,13 +156,13 @@ export const BridgeTransactionButton = ({ onClick: () => dispatch(setIsDestinationWarningAccepted(true)), className: '!from-bgLight !to-bgLight', } - } else if (chain?.id != fromChainId && fromValueBigInt > 0) { + } else if (!onSelectedChain && hasValidInput) { buttonProperties = { label: `Switch to ${chains.find((c) => c.id === fromChainId)?.name}`, onClick: () => switchChain({ chainId: fromChainId }), pendingLabel: 'Switching chains', } - } else if (!isApproved && fromValueBigInt > 0 && bridgeQuote?.destQuery) { + } else if (!isApproved && hasValidInput && hasValidQuote) { buttonProperties = { onClick: approveTxn, label: `Approve ${fromToken?.symbol}`, diff --git a/packages/synapse-interface/components/StateManagedBridge/FromChainSelector.tsx b/packages/synapse-interface/components/StateManagedBridge/FromChainSelector.tsx new file mode 100644 index 0000000000..ecde8d2816 --- /dev/null +++ b/packages/synapse-interface/components/StateManagedBridge/FromChainSelector.tsx @@ -0,0 +1,24 @@ +import { setFromChainId } from '@/slices/bridge/reducer' +import { ChainSelector } from '@/components/ui/ChainSelector' +import { CHAINS_BY_ID } from '@/constants/chains' +import { useFromChainListArray } from './hooks/useFromChainListArray' +import { useBridgeState } from '@/slices/bridge/hooks' +import { useWalletState } from '@/slices/wallet/hooks' + +export const FromChainSelector = () => { + const { fromChainId } = useBridgeState() + const { isWalletPending } = useWalletState() + + return ( + + ) +} diff --git a/packages/synapse-interface/components/StateManagedBridge/FromTokenSelector.tsx b/packages/synapse-interface/components/StateManagedBridge/FromTokenSelector.tsx new file mode 100644 index 0000000000..cdf74c59f7 --- /dev/null +++ b/packages/synapse-interface/components/StateManagedBridge/FromTokenSelector.tsx @@ -0,0 +1,23 @@ +import { setFromToken } from '@/slices/bridge/reducer' +import { TokenSelector } from '@/components/ui/TokenSelector' +import { useBridgeState } from '@/slices/bridge/hooks' +import { useFromTokenListArray } from './hooks/useFromTokenListArray' +import { useWalletState } from '@/slices/wallet/hooks' + +export const FromTokenSelector = () => { + const { fromToken } = useBridgeState() + const { isWalletPending } = useWalletState() + + return ( + + ) +} diff --git a/packages/synapse-interface/components/StateManagedBridge/InputContainer.tsx b/packages/synapse-interface/components/StateManagedBridge/InputContainer.tsx index 564efeea94..c6e70a5ae5 100644 --- a/packages/synapse-interface/components/StateManagedBridge/InputContainer.tsx +++ b/packages/synapse-interface/components/StateManagedBridge/InputContainer.tsx @@ -1,16 +1,9 @@ -import { isNull, isNumber } from 'lodash' +import { debounce, isNull } from 'lodash' import toast from 'react-hot-toast' import React, { useEffect, useState, useCallback, useMemo } from 'react' import { useAccount } from 'wagmi' import { useAppDispatch } from '@/store/hooks' -import { - initialState, - updateFromValue, - setFromChainId, - setFromToken, -} from '@/slices/bridge/reducer' -import { ChainSelector } from '@/components/ui/ChainSelector' -import { TokenSelector } from '@/components/ui/TokenSelector' +import { updateDebouncedFromValue } from '@/slices/bridge/reducer' import { AmountInput } from '@/components/ui/AmountInput' import { cleanNumberInput } from '@/utils/cleanNumberInput' import { @@ -18,47 +11,41 @@ import { ConnectWalletButton, ConnectedIndicator, } from '@/components/ConnectionIndicators' -import { CHAINS_BY_ID } from '@/constants/chains' -import { useFromChainListArray } from './hooks/useFromChainListArray' import { useBridgeState } from '@/slices/bridge/hooks' -import { usePortfolioState } from '@/slices/portfolio/hooks' import { BridgeSectionContainer } from '@/components/ui/BridgeSectionContainer' import { BridgeAmountContainer } from '@/components/ui/BridgeAmountContainer' -import { useFromTokenListArray } from './hooks/useFromTokenListArray' import { AvailableBalance } from './AvailableBalance' import { useGasEstimator } from '../../utils/hooks/useGasEstimator' import { getParsedBalance } from '@/utils/getParsedBalance' import { MaxButton } from './MaxButton' import { formatAmount } from '../../utils/formatAmount' import { useWalletState } from '@/slices/wallet/hooks' +import { FromChainSelector } from '@/components/StateManagedBridge/FromChainSelector' +import { FromTokenSelector } from '@/components/StateManagedBridge/FromTokenSelector' +import { useBridgeSelections } from './hooks/useBridgeSelections' +import { useBridgeValidations } from './hooks/useBridgeValidations' export const inputRef = React.createRef() -export const InputContainer = () => { +interface InputContainerProps { + setIsTyping: React.Dispatch> +} + +export const InputContainer: React.FC = ({ + setIsTyping, +}) => { const dispatch = useAppDispatch() const { chain, isConnected } = useAccount() - const { balances } = usePortfolioState() - const { fromChainId, toChainId, fromToken, toToken, fromValue } = - useBridgeState() const { isWalletPending } = useWalletState() - const [showValue, setShowValue] = useState('') - const [hasMounted, setHasMounted] = useState(false) - - const { addresses, decimals } = fromToken || {} - const tokenDecimals = isNumber(decimals) ? decimals : decimals?.[fromChainId] - const balance: bigint = balances[fromChainId]?.find( - (token) => token.tokenAddress === addresses?.[fromChainId] - )?.balance - const parsedBalance = getParsedBalance(balance, tokenDecimals) - const formattedBalance = formatAmount(parsedBalance) + const { fromChainId, fromToken, debouncedFromValue } = useBridgeState() + const [localInputValue, setLocalInputValue] = useState(debouncedFromValue) - const hasValidFromSelections: boolean = useMemo(() => { - return Boolean(fromChainId && fromToken) - }, [fromChainId, fromToken]) + const { hasValidFromSelections, hasValidSelections, onSelectedChain } = + useBridgeValidations() + const { fromTokenBalance, fromTokenDecimals } = useBridgeSelections() - const hasValidInputSelections: boolean = useMemo(() => { - return Boolean(fromChainId && fromToken && toChainId && toToken) - }, [fromChainId, toChainId, fromToken, toToken]) + const parsedBalance = getParsedBalance(fromTokenBalance, fromTokenDecimals) + const formattedBalance = formatAmount(parsedBalance) const { isLoading, @@ -70,27 +57,69 @@ export const InputContainer = () => { } = useGasEstimator() const isInputMax = - maxBridgeableGas?.toString() === fromValue || parsedBalance === fromValue + maxBridgeableGas?.toString() === debouncedFromValue || + parsedBalance === debouncedFromValue + + const debouncedUpdateFromValue = useMemo( + () => + debounce( + (value: string) => dispatch(updateDebouncedFromValue(value)), + 400 + ), + [dispatch] + ) + + useEffect(() => { + return () => { + debouncedUpdateFromValue.cancel() + } + }, [debouncedUpdateFromValue]) + + const handleFromValueChange = useCallback( + (event: React.ChangeEvent) => { + const cleanedValue = cleanNumberInput(event.target.value) + try { + setLocalInputValue(cleanedValue) + debouncedUpdateFromValue(cleanedValue) + } catch (error) { + console.log('Invalid value for conversion to BigInteger') + const inputValue = event.target.value + const regex = /^[0-9]*[.,]?[0-9]*$/ + + if (regex.test(inputValue) || inputValue === '') { + setLocalInputValue(cleanedValue) + debouncedUpdateFromValue(cleanedValue) + } + } + }, + [debouncedUpdateFromValue] + ) const onMaxBalance = useCallback(async () => { if (hasValidGasEstimateInputs()) { const bridgeableBalance = await estimateBridgeableBalanceCallback() if (isNull(bridgeableBalance)) { - dispatch(updateFromValue(parsedBalance)) + setLocalInputValue(parsedBalance) + dispatch(updateDebouncedFromValue(parsedBalance)) } else if (bridgeableBalance > 0) { - dispatch(updateFromValue(bridgeableBalance?.toString())) + const bridgeableBalanceString = bridgeableBalance.toString() + setLocalInputValue(bridgeableBalanceString) + dispatch(updateDebouncedFromValue(bridgeableBalanceString)) } else { - dispatch(updateFromValue('0.0')) + setLocalInputValue('0.0') + dispatch(updateDebouncedFromValue('0.0')) toast.error('Gas fees likely exceeds your balance.', { id: 'toast-error-not-enough-gas', duration: 10000, }) } } else { - dispatch(updateFromValue(parsedBalance)) + setLocalInputValue(parsedBalance) + dispatch(updateDebouncedFromValue(parsedBalance)) } }, [ + dispatch, fromChainId, fromToken, parsedBalance, @@ -99,47 +128,18 @@ export const InputContainer = () => { ]) useEffect(() => { - setHasMounted(true) - }, []) + setLocalInputValue(debouncedFromValue) + }, [debouncedFromValue]) const connectedStatus = useMemo(() => { - if (hasMounted && !isConnected) { + if (!isConnected) { return - } else if (hasMounted && isConnected && fromChainId === chain?.id) { + } else if (isConnected && onSelectedChain) { return - } else if (hasMounted && isConnected && fromChainId !== chain?.id) { + } else if (isConnected && !onSelectedChain) { return } - }, [chain, fromChainId, isConnected, hasMounted]) - - useEffect(() => { - if (fromToken && tokenDecimals) { - setShowValue(fromValue) - } - - if (fromValue === initialState.fromValue) { - setShowValue(initialState.fromValue) - } - }, [fromValue, inputRef, fromChainId, fromToken]) - - const handleFromValueChange = ( - event: React.ChangeEvent - ) => { - const fromValueString: string = cleanNumberInput(event.target.value) - try { - dispatch(updateFromValue(fromValueString)) - setShowValue(fromValueString) - } catch (error) { - console.error('Invalid value for conversion to BigInteger') - const inputValue = event.target.value - const regex = /^[0-9]*[.,]?[0-9]*$/ - - if (regex.test(inputValue) || inputValue === '') { - dispatch(updateFromValue(inputValue)) - setShowValue(inputValue) - } - } - } + }, [chain, fromChainId, isConnected]) return ( @@ -151,8 +151,9 @@ export const InputContainer = () => {
    @@ -168,7 +169,7 @@ export const InputContainer = () => { onClick={onMaxBalance} isHidden={ !isConnected || - !hasValidInputSelections || + !hasValidSelections || isLoading || isInputMax || isWalletPending @@ -179,39 +180,3 @@ export const InputContainer = () => { ) } - -const FromChainSelector = () => { - const { fromChainId } = useBridgeState() - const { isWalletPending } = useWalletState() - - return ( - - ) -} - -const FromTokenSelector = () => { - const { fromToken } = useBridgeState() - const { isWalletPending } = useWalletState() - - return ( - - ) -} diff --git a/packages/synapse-interface/components/StateManagedBridge/OutputContainer.tsx b/packages/synapse-interface/components/StateManagedBridge/OutputContainer.tsx index 9d3459e551..9f06ed4bd2 100644 --- a/packages/synapse-interface/components/StateManagedBridge/OutputContainer.tsx +++ b/packages/synapse-interface/components/StateManagedBridge/OutputContainer.tsx @@ -1,4 +1,5 @@ import { useAccount } from 'wagmi' +import { useMemo } from 'react' import { ChainSelector } from '@/components/ui/ChainSelector' import { TokenSelector } from '@/components/ui/TokenSelector' @@ -12,16 +13,24 @@ import { CHAINS_BY_ID } from '@/constants/chains' import { setToChainId, setToToken } from '@/slices/bridge/reducer' import { useBridgeDisplayState, useBridgeState } from '@/slices/bridge/hooks' import { useWalletState } from '@/slices/wallet/hooks' +import { useBridgeQuoteState } from '@/slices/bridgeQuote/hooks' +import { useBridgeValidations } from './hooks/useBridgeValidations' export const OutputContainer = () => { const { address } = useAccount() - const { bridgeQuote, isLoading } = useBridgeState() + const { bridgeQuote, isLoading } = useBridgeQuoteState() const { showDestinationAddress } = useBridgeDisplayState() + const { hasValidInput, hasValidQuote } = useBridgeValidations() - const showValue = - bridgeQuote?.outputAmountString === '0' - ? '' - : bridgeQuote?.outputAmountString + const showValue = useMemo(() => { + if (!hasValidInput) { + return '' + } else if (hasValidQuote) { + return bridgeQuote?.outputAmountString + } else { + return '' + } + }, [bridgeQuote, hasValidInput, hasValidQuote]) return ( diff --git a/packages/synapse-interface/components/StateManagedBridge/hooks/useBridgeSelections.ts b/packages/synapse-interface/components/StateManagedBridge/hooks/useBridgeSelections.ts new file mode 100644 index 0000000000..6a6af1dbd2 --- /dev/null +++ b/packages/synapse-interface/components/StateManagedBridge/hooks/useBridgeSelections.ts @@ -0,0 +1,30 @@ +import { useBridgeState } from '@/slices/bridge/hooks' +import { BridgeState } from '@/slices/bridge/reducer' +import { usePortfolioBalances } from '@/slices/portfolio/hooks' +import { stringToBigInt } from '@/utils/bigint/format' + +export const useBridgeSelections = () => { + const { fromChainId, fromToken, debouncedFromValue }: BridgeState = + useBridgeState() + const balances = usePortfolioBalances() + + const fromTokenDecimals = fromToken?.decimals[fromChainId] + const fromTokenAddress = fromToken?.addresses[fromChainId] + + const fromChainBalances = balances[fromChainId] + const fromTokenBalance = fromChainBalances?.find( + (t) => t.tokenAddress === fromTokenAddress + )?.balance + + const debouncedFromValueBigInt = stringToBigInt( + debouncedFromValue, + fromTokenDecimals + ) + + return { + fromTokenBalance, + fromTokenDecimals, + fromTokenAddress, + debouncedFromValueBigInt, + } +} diff --git a/packages/synapse-interface/components/StateManagedBridge/hooks/useBridgeValidations.ts b/packages/synapse-interface/components/StateManagedBridge/hooks/useBridgeValidations.ts new file mode 100644 index 0000000000..e64ac72587 --- /dev/null +++ b/packages/synapse-interface/components/StateManagedBridge/hooks/useBridgeValidations.ts @@ -0,0 +1,129 @@ +import { useMemo } from 'react' +import { useAccount } from 'wagmi' + +import { useBridgeState } from '@/slices/bridge/hooks' +import { BridgeState } from '@/slices/bridge/reducer' +import { useBridgeQuoteState } from '@/slices/bridgeQuote/hooks' +import { BridgeQuoteState } from '@/slices/bridgeQuote/reducer' +import { EMPTY_BRIDGE_QUOTE } from '@/constants/bridge' +import { hasOnlyZeroes } from '@/utils/hasOnlyZeroes' +import { useBridgeSelections } from './useBridgeSelections' + +export const useBridgeValidations = () => { + const { chainId } = useAccount() + const { + fromChainId, + toChainId, + fromToken, + toToken, + debouncedFromValue, + }: BridgeState = useBridgeState() + const { bridgeQuote }: BridgeQuoteState = useBridgeQuoteState() + const { fromTokenBalance, debouncedFromValueBigInt } = useBridgeSelections() + + const hasValidInput: boolean = useMemo(() => { + if (debouncedFromValue === '') return false + if (hasOnlyZeroes(debouncedFromValue)) return false + return debouncedFromValueBigInt > 0n + }, [debouncedFromValue, debouncedFromValueBigInt]) + + const hasValidFromSelections = useMemo(() => { + return Boolean(fromChainId && fromToken) + }, [fromChainId, fromToken]) + + const hasValidSelections = useMemo(() => { + return Boolean(fromChainId && fromToken && toChainId && toToken) + }, [fromChainId, fromToken, toChainId, toToken]) + + const hasValidQuote: boolean = useMemo(() => { + return bridgeQuote !== EMPTY_BRIDGE_QUOTE + }, [bridgeQuote]) + + const hasSufficientBalance: boolean = useMemo(() => { + return hasValidSelections + ? debouncedFromValueBigInt <= fromTokenBalance + : false + }, [hasValidSelections, debouncedFromValueBigInt, fromTokenBalance]) + + const stringifiedBridgeQuote = useMemo(() => { + return constructStringifiedBridgeSelections( + bridgeQuote.inputAmountForQuote, + bridgeQuote.originChainId, + bridgeQuote.originTokenForQuote, + bridgeQuote.destChainId, + bridgeQuote.destTokenForQuote + ) + }, [ + bridgeQuote.inputAmountForQuote, + bridgeQuote.originChainId, + bridgeQuote.originTokenForQuote, + bridgeQuote.destChainId, + bridgeQuote.destTokenForQuote, + ]) + + const stringifiedBridgeState = useMemo(() => { + return constructStringifiedBridgeSelections( + debouncedFromValue, + fromChainId, + fromToken, + toChainId, + toToken + ) + }, [debouncedFromValue, fromChainId, fromToken, toChainId, toToken]) + + const doesBridgeStateMatchQuote = useMemo(() => { + return stringifiedBridgeQuote === stringifiedBridgeState + }, [stringifiedBridgeQuote, stringifiedBridgeState]) + + const isBridgeQuoteAmountGreaterThanInputForRfq = useMemo(() => { + return ( + bridgeQuote.bridgeModuleName === 'SynapseRFQ' && + bridgeQuote.outputAmount > debouncedFromValueBigInt + ) + }, [ + bridgeQuote.outputAmount, + bridgeQuote.bridgeModuleName, + debouncedFromValueBigInt, + ]) + + const isBridgeFeeGreaterThanInput = useMemo(() => { + return ( + bridgeQuote.bridgeModuleName !== null && + bridgeQuote.feeAmount === 0n && + debouncedFromValueBigInt > 0n + ) + }, [bridgeQuote.feeAmount, debouncedFromValueBigInt]) + + const onSelectedChain: boolean = useMemo(() => { + return chainId === fromChainId + }, [fromChainId, chainId]) + + return { + hasValidInput, + hasValidFromSelections, + hasValidSelections, + hasValidQuote, + hasSufficientBalance, + doesBridgeStateMatchQuote, + isBridgeFeeGreaterThanInput, + isBridgeQuoteAmountGreaterThanInputForRfq, + onSelectedChain, + } +} + +const constructStringifiedBridgeSelections = ( + originAmount, + originChainId, + originToken, + destChainId, + destToken +) => { + const state = { + originAmount, + originChainId, + originToken, + destChainId, + destToken, + } + return JSON.stringify(state) +} diff --git a/packages/synapse-interface/components/StateManagedSwap/SwapInputContainer.tsx b/packages/synapse-interface/components/StateManagedSwap/SwapInputContainer.tsx index 571e225900..135b672dc6 100644 --- a/packages/synapse-interface/components/StateManagedSwap/SwapInputContainer.tsx +++ b/packages/synapse-interface/components/StateManagedSwap/SwapInputContainer.tsx @@ -30,8 +30,15 @@ import { trimTrailingZeroesAfterDecimal } from '@/utils/trimTrailingZeroesAfterD import { formatAmount } from '@/utils/formatAmount' import { getParsedBalance } from '@/utils/getParsedBalance' import { useWalletState } from '@/slices/wallet/hooks' +import { debounce } from 'lodash' -export const SwapInputContainer = () => { +interface InputContainerProps { + setIsTyping: React.Dispatch> +} + +export const SwapInputContainer: React.FC = ({ + setIsTyping, +}) => { const inputRef = useRef(null) const { swapChainId, swapFromToken, swapToToken, swapFromValue } = useSwapState() @@ -77,20 +84,32 @@ export const SwapInputContainer = () => { } }, [swapFromValue, swapChainId, swapFromToken]) + const debouncedUpdateSwapFromValue = useMemo( + () => + debounce((value: string) => dispatch(updateSwapFromValue(value)), 400), + [dispatch] + ) + + useEffect(() => { + return () => { + debouncedUpdateSwapFromValue.cancel() + } + }, [debouncedUpdateSwapFromValue]) + const handleFromValueChange = ( event: React.ChangeEvent ) => { const swapFromValueString: string = cleanNumberInput(event.target.value) try { - dispatch(updateSwapFromValue(swapFromValueString)) setShowValue(swapFromValueString) + debouncedUpdateSwapFromValue(swapFromValueString) } catch (error) { console.error('Invalid value for conversion to BigInteger') const inputValue = event.target.value const regex = /^[0-9]*[.,]?[0-9]*$/ if (regex.test(inputValue) || inputValue === '') { - dispatch(updateSwapFromValue('')) + debouncedUpdateSwapFromValue(inputValue) setShowValue(inputValue) } } @@ -134,6 +153,7 @@ export const SwapInputContainer = () => {
    { - const currentTime = getTimeMinutesBeforeNow(0) + const currentTime = getUnixTimeMinutesBeforeNow(0) const elapsedTime = currentTime - startTime const remainingTime = estDuration - elapsedTime const percentElapsed = (elapsedTime / estDuration) * 100 diff --git a/packages/synapse-interface/components/ui/AmountInput.tsx b/packages/synapse-interface/components/ui/AmountInput.tsx index b7bc8b9e03..6739fb2e3e 100644 --- a/packages/synapse-interface/components/ui/AmountInput.tsx +++ b/packages/synapse-interface/components/ui/AmountInput.tsx @@ -1,4 +1,5 @@ -import React from 'react' +import React, { useState, useEffect, useCallback } from 'react' +import { debounce } from 'lodash' import LoadingDots from './tailwind/LoadingDots' import { joinClassNames } from '@/utils/joinClassNames' @@ -8,6 +9,7 @@ interface AmountInputTypes { isLoading?: boolean showValue: string handleFromValueChange?: (event: React.ChangeEvent) => void + setIsTyping?: (isTyping: boolean) => void } export function AmountInput({ @@ -16,7 +18,19 @@ export function AmountInput({ isLoading = false, showValue, handleFromValueChange, + setIsTyping, }: AmountInputTypes) { + const debouncedSetIsTyping = useCallback( + debounce((value: boolean) => setIsTyping?.(value), 600), + [setIsTyping] + ) + + const handleInputChange = (event: React.ChangeEvent) => { + setIsTyping?.(true) + debouncedSetIsTyping(false) + handleFromValueChange?.(event) + } + const inputClassName = joinClassNames({ unset: 'bg-transparent border-none p-0', layout: 'w-full', @@ -37,7 +51,7 @@ export function AmountInput({ readOnly={disabled} className={inputClassName} placeholder="0.0000" - onChange={handleFromValueChange} + onChange={handleInputChange} value={showValue} name="inputRow" autoComplete="off" diff --git a/packages/synapse-interface/constants/bridge.ts b/packages/synapse-interface/constants/bridge.ts index 40708c1f1a..d201896fd9 100644 --- a/packages/synapse-interface/constants/bridge.ts +++ b/packages/synapse-interface/constants/bridge.ts @@ -4,6 +4,10 @@ import * as CHAINS from '@constants/chains/master' export const QUOTE_POLLING_INTERVAL = 10000 export const EMPTY_BRIDGE_QUOTE = { + id: '', + inputAmountForQuote: '', + originTokenForQuote: null, + destTokenForQuote: null, outputAmount: 0n, outputAmountString: '', routerAddress: '', @@ -19,25 +23,9 @@ export const EMPTY_BRIDGE_QUOTE = { timestamp: null, originChainId: null, destChainId: null, + requestId: null, } -export const EMPTY_BRIDGE_QUOTE_ZERO = { - outputAmount: 0n, - outputAmountString: '0', - routerAddress: '', - allowance: 0n, - exchangeRate: 0n, - feeAmount: 0n, - delta: 0n, - originQuery: null, - destQuery: null, - estimatedTime: null, - bridgeModuleName: null, - gasDropAmount: 0n, - timestamp: null, - originChainId: null, - destChainId: null, -} /** * ETH Only Bridge Config used to calculate swap fees * diff --git a/packages/synapse-interface/constants/bridgeMap.ts b/packages/synapse-interface/constants/bridgeMap.ts index e2ad92cb29..b1fb3a1d35 100644 --- a/packages/synapse-interface/constants/bridgeMap.ts +++ b/packages/synapse-interface/constants/bridgeMap.ts @@ -894,6 +894,13 @@ export const BRIDGE_MAP = { destination: ['SYN'], swappable: [], }, + '0x75cb093E4D61d2A2e65D8e0BBb01DE8d89b53481': { + decimals: 18, + symbol: 'WMETIS', + origin: ['Metis'], + destination: ['Metis'], + swappable: [], + }, '0x931B8f17764362A3325D30681009f0eDd6211231': { decimals: 18, symbol: 'nETH', @@ -922,6 +929,13 @@ export const BRIDGE_MAP = { destination: ['nUSD'], swappable: ['0x961318Fc85475E125B99Cc9215f62679aE5200aB'], }, + '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE': { + decimals: 18, + symbol: 'Metis', + origin: ['Metis'], + destination: ['Metis'], + swappable: [], + }, '0xFB21B70922B9f6e3C6274BcD6CB1aa8A0fe20B80': { decimals: 18, symbol: 'gOHM', @@ -1179,6 +1193,13 @@ export const BRIDGE_MAP = { destination: ['JEWEL'], swappable: [], }, + '0x543f1b2176F7E677a95D01ca83551FAa08F83D9F': { + decimals: 18, + symbol: 'Metis', + origin: ['Metis'], + destination: ['Metis'], + swappable: [], + }, '0x5819b6af194A78511c79C85Ea68D2377a7e9335f': { decimals: 18, symbol: 'WKLAY', @@ -1736,6 +1757,13 @@ export const BRIDGE_MAP = { destination: ['nUSD'], swappable: [], }, + '0x43E8E55792D6317328e5c6B0A0C89eF4b8102Fa2': { + decimals: 18, + symbol: 'Metis', + origin: ['Metis'], + destination: ['Metis'], + swappable: [], + }, '0x7516EB8B8Edfa420f540a162335eACF3ea05a247': { decimals: 8, symbol: 'BTC.b', diff --git a/packages/synapse-interface/constants/chains/master.tsx b/packages/synapse-interface/constants/chains/master.tsx index 711199cdf7..0869253840 100644 --- a/packages/synapse-interface/constants/chains/master.tsx +++ b/packages/synapse-interface/constants/chains/master.tsx @@ -351,7 +351,7 @@ export const METIS: Chain = { }, nativeCurrency: { name: 'Metis', - symbol: 'METIS', + symbol: 'Metis', decimals: 18, address: zeroAddress, icon: metisImg, diff --git a/packages/synapse-interface/constants/tokens/bridgeable.ts b/packages/synapse-interface/constants/tokens/bridgeable.ts index d674f4984b..b5a97e3714 100644 --- a/packages/synapse-interface/constants/tokens/bridgeable.ts +++ b/packages/synapse-interface/constants/tokens/bridgeable.ts @@ -19,6 +19,7 @@ import klayLogo from '@assets/icons/klay.svg' import l2daoLogo from '@assets/icons/l2dao.svg' import lusdLogo from '@assets/icons/lusd.svg' import maticLogo from '@assets/icons/matic.svg' +import metisLogo from '@assets/icons/metis.svg' import movrLogo from '@assets/icons/movr.svg' import nethLogo from '@assets/icons/neth.svg' import newoLogo from '@assets/icons/newo.svg' @@ -1209,3 +1210,23 @@ export const SPECTRAL = new Token({ color: 'blue', routeSymbol: 'SPEC', }) + +export const METIS = new Token({ + priorityRank: 300, + addresses: { + [CHAINS.DFK.id]: '0x43E8E55792D6317328e5c6B0A0C89eF4b8102Fa2', + [CHAINS.KLAYTN.id]: '0x543f1b2176F7E677a95D01ca83551FAa08F83D9F', + [CHAINS.METIS.id]: zeroAddress, + }, + decimals: { + [CHAINS.DFK.id]: 18, + [CHAINS.KLAYTN.id]: 18, + [CHAINS.METIS.id]: 18, + }, + symbol: 'Metis', + name: 'Metis Token', + swapableType: 'Metis', + logo: metisLogo, + color: 'blue', + routeSymbol: 'Metis', +}) diff --git a/packages/synapse-interface/constants/tokens/index.ts b/packages/synapse-interface/constants/tokens/index.ts index deddbc8daa..97f1f31001 100644 --- a/packages/synapse-interface/constants/tokens/index.ts +++ b/packages/synapse-interface/constants/tokens/index.ts @@ -37,6 +37,7 @@ export const PAUSED_TOKENS_BY_CHAIN = { [CHAINS.BOBA.id]: ['WETH'], [CHAINS.MOONBEAM.id]: ['WETH'], [CHAINS.BASE.id]: ['WETH'], + [CHAINS.BLAST.id]: ['WETH'], [CHAINS.ARBITRUM.id]: ['WETH'], [CHAINS.FANTOM.id]: [], [CHAINS.DOGE.id]: ['BUSD', 'WETH'], diff --git a/packages/synapse-interface/contexts/BackgroundListenerProvider.tsx b/packages/synapse-interface/contexts/BackgroundListenerProvider.tsx index 5f3c5b1b70..70f5605d4a 100644 --- a/packages/synapse-interface/contexts/BackgroundListenerProvider.tsx +++ b/packages/synapse-interface/contexts/BackgroundListenerProvider.tsx @@ -1,7 +1,6 @@ import React, { createContext } from 'react' import { useApplicationListener } from '@/utils/hooks/useApplicationListener' -import { useBridgeListener } from '@/utils/hooks/useBridgeListener' import { usePortfolioListener } from '@/utils/hooks/usePortfolioListener' import { useRiskEvent } from '@/utils/hooks/useRiskEvent' import { useTransactionListener } from '@/utils/hooks/useTransactionListener' @@ -18,7 +17,6 @@ export const BackgroundListenerProvider = ({ children }) => { usePortfolioListener() useTransactionListener() use_TransactionsListener() - useBridgeListener() useRiskEvent() useFetchPricesOnInterval() useFetchGasDataOnInterval() diff --git a/packages/synapse-interface/package.json b/packages/synapse-interface/package.json index 2d73fce04a..04454b91ec 100644 --- a/packages/synapse-interface/package.json +++ b/packages/synapse-interface/package.json @@ -1,6 +1,6 @@ { "name": "@synapsecns/synapse-interface", - "version": "0.34.4", + "version": "0.37.0", "private": true, "engines": { "node": ">=18.18.0" @@ -34,7 +34,7 @@ "@reduxjs/toolkit": "^1.9.5", "@rtk-query/graphql-request-base-query": "^2.2.0", "@segment/analytics-next": "^1.53.0", - "@synapsecns/sdk-router": "^0.10.0", + "@synapsecns/sdk-router": "^0.11.0", "@tailwindcss/aspect-ratio": "^0.4.2", "@tailwindcss/forms": "^0.5.3", "@tailwindcss/typography": "^0.5.9", @@ -71,6 +71,7 @@ "tailwindcss-border-gradient-radius": "^3.0.1", "typescript": "5.1.6", "use-persisted-state": "^0.3.3", + "uuidv7": "^1.0.1", "viem": "^2.13.6", "wagmi": "^2.9.8", "yarn": "^1.22.19" @@ -96,9 +97,9 @@ "keywords": [], "devDependencies": { "@depay/web3-mock": "^14.0.0", - "@graphql-codegen/cli": "5.0.0", - "@graphql-codegen/client-preset": "4.1.0", - "@graphql-codegen/introspection": "4.0.0", + "@graphql-codegen/cli": "5.0.2", + "@graphql-codegen/client-preset": "4.3.3", + "@graphql-codegen/introspection": "4.0.3", "@graphql-codegen/typescript-rtk-query": "^2.4.1", "@testing-library/react": "^14.0.0", "@types/react": "^18.2.67", diff --git a/packages/synapse-interface/pages/state-managed-bridge/index.tsx b/packages/synapse-interface/pages/state-managed-bridge/index.tsx index fc86e9456e..df9e76925a 100644 --- a/packages/synapse-interface/pages/state-managed-bridge/index.tsx +++ b/packages/synapse-interface/pages/state-managed-bridge/index.tsx @@ -1,6 +1,5 @@ import toast from 'react-hot-toast' import { useEffect, useRef, useState } from 'react' -import { commify } from '@ethersproject/units' import { Address, zeroAddress, isAddress } from 'viem' import { polygon } from 'viem/chains' import { useAccount } from 'wagmi' @@ -25,8 +24,7 @@ import Button from '@/components/ui/tailwind/Button' import { SettingsToggle } from '@/components/StateManagedBridge/SettingsToggle' import { BridgeCard } from '@/components/ui/BridgeCard' import { ConfirmDestinationAddressWarning } from '@/components/StateManagedBridge/BridgeWarnings' -import { EMPTY_BRIDGE_QUOTE_ZERO } from '@/constants/bridge' -import { AcceptedChainId, CHAINS_BY_ID } from '@/constants/chains' +import { CHAINS_BY_ID } from '@/constants/chains' import { segmentAnalyticsEvent } from '@/contexts/SegmentAnalyticsProvider' import { useBridgeState } from '@/slices/bridge/hooks' import { @@ -35,10 +33,8 @@ import { setFromToken, setToChainId, setToToken, - updateFromValue, - setBridgeQuote, - setIsLoading, setDestinationAddress, + updateDebouncedFromValue, } from '@/slices/bridge/reducer' import { setIsWalletPending } from '@/slices/wallet/reducer' import { @@ -46,9 +42,6 @@ import { setShowSettingsSlideOver, } from '@/slices/bridgeDisplaySlice' import { useSynapseContext } from '@/utils/providers/SynapseProvider' -import { getErc20TokenAllowance } from '@/actions/getErc20TokenAllowance' -import { formatBigIntToString } from '@/utils/bigint/format' -import { calculateExchangeRate } from '@/utils/calculateExchangeRate' import { Token } from '@/utils/types' import { txErrorHandler } from '@/utils/txErrorHandler' import { approveToken } from '@/utils/approveToken' @@ -61,17 +54,22 @@ import { } from '@/slices/transactions/actions' import { useAppDispatch } from '@/store/hooks' import { RootState } from '@/store/store' -import { getTimeMinutesFromNow } from '@/utils/time' +import { calculateTimeBetween, getUnixTimeMinutesFromNow } from '@/utils/time' import { isTransactionReceiptError } from '@/utils/isTransactionReceiptError' -import { isTransactionUserRejectedError } from '@/utils/isTransactionUserRejectedError' -import { useMaintenance } from '@/components/Maintenance/Maintenance' -import { getBridgeModuleNames } from '@/utils/getBridgeModuleNames' import { wagmiConfig } from '@/wagmiConfig' import { useStaleQuoteUpdater } from '@/utils/hooks/useStaleQuoteUpdater' +import { convertUuidToUnix } from '@/utils/convertUuidToUnix' +import { useMaintenance } from '@/components/Maintenance/Maintenance' +import { getBridgeModuleNames } from '@/utils/getBridgeModuleNames' import { screenAddress } from '@/utils/screenAddress' import { useWalletState } from '@/slices/wallet/hooks' +import { useBridgeQuoteState } from '@/slices/bridgeQuote/hooks' +import { resetBridgeQuote } from '@/slices/bridgeQuote/reducer' +import { fetchBridgeQuote } from '@/slices/bridgeQuote/thunks' +import { useIsBridgeApproved } from '@/utils/hooks/useIsBridgeApproved' const StateManagedBridge = () => { + const dispatch = useAppDispatch() const { address } = useAccount() const { synapseSDK } = useSynapseContext() const router = useRouter() @@ -80,21 +78,26 @@ const StateManagedBridge = () => { const bridgeDisplayRef = useRef(null) const currentSDKRequestID = useRef(0) const quoteToastRef = useRef({ id: '' }) + const quoteTimeout = 15000 + + const [isTyping, setIsTyping] = useState(false) const { fromChainId, toChainId, fromToken, toToken, - bridgeQuote, debouncedFromValue, destinationAddress, - isLoading: isQuoteLoading, }: BridgeState = useBridgeState() + const { bridgeQuote, isLoading } = useBridgeQuoteState() + + const isApproved = useIsBridgeApproved() + const { isWalletPending } = useWalletState() - const { showSettingsSlideOver, showDestinationAddress } = useSelector( + const { showSettingsSlideOver } = useSelector( (state: RootState) => state.bridgeDisplay ) @@ -105,10 +108,6 @@ const StateManagedBridge = () => { BridgeMaintenanceWarningMessage, } = useMaintenance() - const [isApproved, setIsApproved] = useState(false) - - const dispatch = useAppDispatch() - useEffect(() => { segmentAnalyticsEvent(`[Bridge page] arrives`, { fromChainId, @@ -127,205 +126,50 @@ const StateManagedBridge = () => { console.log('trying to set bridge quote') getAndSetBridgeQuote() } else { - dispatch(setBridgeQuote(EMPTY_BRIDGE_QUOTE_ZERO)) - dispatch(setIsLoading(false)) + dispatch(resetBridgeQuote()) } }, [fromChainId, toChainId, fromToken, toToken, debouncedFromValue]) - // don't like this, rewrite: could be custom hook - useEffect(() => { - if (fromToken && fromToken?.addresses[fromChainId] === zeroAddress) { - setIsApproved(true) - } else { - if ( - fromToken && - bridgeQuote?.allowance && - stringToBigInt(debouncedFromValue, fromToken.decimals[fromChainId]) <= - bridgeQuote.allowance - ) { - setIsApproved(true) - } else { - setIsApproved(false) - } - } - }, [bridgeQuote, fromToken, debouncedFromValue, fromChainId, toChainId]) - const getAndSetBridgeQuote = async () => { currentSDKRequestID.current += 1 const thisRequestId = currentSDKRequestID.current + // will have to handle deadlineMinutes here at later time, gets passed as optional last arg in .bridgeQuote() /* clear stored bridge quote before requesting new bridge quote */ - dispatch(setBridgeQuote(EMPTY_BRIDGE_QUOTE_ZERO)) + dispatch(resetBridgeQuote()) + const currentTimestamp: number = getUnixTimeMinutesFromNow(0) try { - dispatch(setIsLoading(true)) - const currentTimestamp: number = getTimeMinutesFromNow(0) - - const allQuotes = await synapseSDK.allBridgeQuotes( - fromChainId, - toChainId, - fromToken.addresses[fromChainId], - toToken.addresses[toChainId], - stringToBigInt(debouncedFromValue, fromToken?.decimals[fromChainId]), - { - originUserAddress: address, - } - ) - - const pausedBridgeModules = new Set( - pausedModulesList - .filter((module) => - module.chainId ? module.chainId === fromChainId : true - ) - .flatMap(getBridgeModuleNames) - ) - - const activeQuotes = allQuotes.filter( - (quote) => !pausedBridgeModules.has(quote.bridgeModuleName) - ) - - if (activeQuotes.length === 0) { - const msg = `No route found for bridging ${debouncedFromValue} ${fromToken?.symbol} on ${CHAINS_BY_ID[fromChainId]?.name} to ${toToken?.symbol} on ${CHAINS_BY_ID[toChainId]?.name}` - throw new Error(msg) - } - - const rfqQuote = activeQuotes.find( - (quote) => quote.bridgeModuleName === 'SynapseRFQ' - ) - - const nonRfqQuote = activeQuotes.find( - (quote) => quote.bridgeModuleName !== 'SynapseRFQ' - ) - - let quote - - if (rfqQuote && nonRfqQuote) { - const rfqMaxAmountOut = BigInt(rfqQuote.maxAmountOut.toString()) - const nonRfqMaxAmountOut = BigInt(nonRfqQuote.maxAmountOut.toString()) - - const allowedPercentileDifference = 30n - const maxDifference = - (nonRfqMaxAmountOut * allowedPercentileDifference) / 100n - - if (rfqMaxAmountOut > nonRfqMaxAmountOut - maxDifference) { - quote = rfqQuote - } else { - quote = nonRfqQuote - - segmentAnalyticsEvent(`[Bridge] use non-RFQ quote over RFQ`, { - bridgeModuleName: nonRfqQuote.bridgeModuleName, - originChainId: fromChainId, - originToken: fromToken.symbol, - originTokenAddress: fromToken.addresses[fromChainId], - destinationChainId: toChainId, - destinationToken: toToken.symbol, - destinationTokenAddress: toToken.addresses[toChainId], - rfqQuoteAmountOut: rfqQuote.maxAmountOut.toString(), - nonRfqMaxAmountOut: nonRfqQuote.maxAmountOut.toString(), - }) - } - } else { - quote = rfqQuote ?? nonRfqQuote - } - - const { - feeAmount, - routerAddress, - maxAmountOut, - originQuery, - destQuery, - estimatedTime, - bridgeModuleName, - gasDropAmount, - originChainId, - destChainId, - } = quote - - if (!(originQuery && maxAmountOut && destQuery && feeAmount)) { - dispatch(setBridgeQuote(EMPTY_BRIDGE_QUOTE_ZERO)) - dispatch(setIsLoading(false)) - return - } - - const toValueBigInt = BigInt(maxAmountOut.toString()) ?? 0n - - // Bridge Lifecycle: originToken -> bridgeToken -> destToken - // debouncedFromValue is in originToken decimals - // originQuery.minAmountOut and feeAmount is in bridgeToken decimals - // Adjust feeAmount to be in originToken decimals - const adjustedFeeAmount = - (BigInt(feeAmount) * - stringToBigInt( - `${debouncedFromValue}`, - fromToken?.decimals[fromChainId] - )) / - BigInt(originQuery.minAmountOut) - - const isUnsupported = AcceptedChainId[fromChainId] ? false : true - - const allowance = - fromToken?.addresses[fromChainId] === zeroAddress || - address === undefined || - isUnsupported - ? 0n - : await getErc20TokenAllowance({ - address, - chainId: fromChainId, - tokenAddress: fromToken?.addresses[fromChainId] as Address, - spender: routerAddress, - }) - - const { - originQuery: originQueryWithSlippage, - destQuery: destQueryWithSlippage, - } = synapseSDK.applyBridgeSlippage( - bridgeModuleName, - originQuery, - destQuery - ) - if (thisRequestId === currentSDKRequestID.current) { - dispatch( - setBridgeQuote({ - outputAmount: toValueBigInt, - outputAmountString: commify( - formatBigIntToString( - toValueBigInt, - toToken.decimals[toChainId], - 8 - ) - ), - routerAddress, - allowance, - exchangeRate: calculateExchangeRate( - stringToBigInt( - debouncedFromValue, - fromToken?.decimals[fromChainId] - ) - BigInt(adjustedFeeAmount), - fromToken?.decimals[fromChainId], - toValueBigInt, - toToken.decimals[toChainId] - ), - feeAmount, - delta: BigInt(maxAmountOut.toString()), - originQuery: originQueryWithSlippage, - destQuery: destQueryWithSlippage, - estimatedTime: estimatedTime, - bridgeModuleName: bridgeModuleName, - gasDropAmount: BigInt(gasDropAmount.toString()), - timestamp: currentTimestamp, - originChainId, - destChainId, + const result = await dispatch( + fetchBridgeQuote({ + synapseSDK, + fromChainId, + toChainId, + fromToken, + toToken, + debouncedFromValue, + requestId: thisRequestId, + currentTimestamp, + address, + pausedModulesList, }) ) toast.dismiss(quoteToastRef.current.id) - const message = `Route found for bridging ${debouncedFromValue} ${fromToken?.symbol} on ${CHAINS_BY_ID[fromChainId]?.name} to ${toToken.symbol} on ${CHAINS_BY_ID[toChainId]?.name}` - console.log(message) + if (fetchBridgeQuote.fulfilled.match(result)) { + const message = `Route found for bridging ${debouncedFromValue} ${fromToken?.symbol} on ${CHAINS_BY_ID[fromChainId]?.name} to ${toToken.symbol} on ${CHAINS_BY_ID[toChainId]?.name}` - quoteToastRef.current.id = toast(message, { duration: 3000 }) + quoteToastRef.current.id = toast(message, { duration: 3000 }) + } + + if (fetchBridgeQuote.rejected.match(result)) { + const message = result.payload as string + + quoteToastRef.current.id = toast(message, { duration: 3000 }) + } } } catch (err) { console.log(err) @@ -347,22 +191,19 @@ const StateManagedBridge = () => { console.log(message) quoteToastRef.current.id = toast(message, { duration: 3000 }) - dispatch(setBridgeQuote(EMPTY_BRIDGE_QUOTE_ZERO)) + dispatch(resetBridgeQuote()) return } - } finally { - if (thisRequestId === currentSDKRequestID.current) { - dispatch(setIsLoading(false)) - } } } useStaleQuoteUpdater( bridgeQuote, getAndSetBridgeQuote, - isQuoteLoading, - isWalletPending + isLoading, + isWalletPending, + quoteTimeout ) const approveTxn = async () => { @@ -387,6 +228,8 @@ const StateManagedBridge = () => { const executeBridge = async () => { let pendingPopup: any + const currentTimestamp: number = getUnixTimeMinutesFromNow(0) + if (destinationAddress) { const isRisky = await screenAddress(destinationAddress) if (isRisky) { @@ -397,6 +240,7 @@ const StateManagedBridge = () => { segmentAnalyticsEvent( `[Bridge] initiates bridge`, { + id: bridgeQuote.id, originChainId: fromChainId, destinationChainId: toChainId, inputAmount: debouncedFromValue, @@ -410,7 +254,7 @@ const StateManagedBridge = () => { }, true ) - const currentTimestamp: number = getTimeMinutesFromNow(0) + dispatch( addPendingBridgeTransaction({ id: currentTimestamp, @@ -476,6 +320,7 @@ const StateManagedBridge = () => { { id: 'bridge-in-progress-popup', duration: Infinity } ) segmentAnalyticsEvent(`[Bridge] bridges successfully`, { + id: bridgeQuote.id, originChainId: fromChainId, destinationChainId: toChainId, inputAmount: debouncedFromValue, @@ -495,10 +340,10 @@ const StateManagedBridge = () => { isSubmitted: false, }) ) - dispatch(setBridgeQuote(EMPTY_BRIDGE_QUOTE_ZERO)) + dispatch(resetBridgeQuote()) dispatch(setDestinationAddress(null)) dispatch(setShowDestinationAddress(false)) - dispatch(updateFromValue('')) + dispatch(updateDebouncedFromValue('')) const successToastContent = (
    @@ -520,11 +365,10 @@ const StateManagedBridge = () => { toast.dismiss(pendingPopup) - const transactionReceipt = await waitForTransactionReceipt(wagmiConfig, { + await waitForTransactionReceipt(wagmiConfig, { hash: tx as Address, timeout: 60_000, }) - console.log('Transaction Receipt: ', transactionReceipt) /** Update Origin Chain token balances after resolved tx or timeout reached */ /** Assume tx has been actually resolved if above times out */ @@ -541,7 +385,7 @@ const StateManagedBridge = () => { errorCode: error.code, }) dispatch(removePendingBridgeTransaction(currentTimestamp)) - console.log('Error executing bridge', error) + console.error('Error executing bridge: ', error) toast.dismiss(pendingPopup) /** Fetch balances if await transaction receipt times out */ @@ -587,7 +431,7 @@ const StateManagedBridge = () => {
    ) : ( <> - + { dispatch(setFromChainId(toChainId)) @@ -603,6 +447,7 @@ const StateManagedBridge = () => { { const router = useRouter() const { query, pathname } = router + const [isTyping, setIsTyping] = useState(false) + useSyncQueryParamsWithSwapState() const { balances: portfolioBalances } = useFetchPortfolioBalances() @@ -354,7 +356,7 @@ const StateManagedSwap = () => {
    - + { dispatch(setSwapFromToken(swapToToken)) @@ -378,6 +380,7 @@ const StateManagedSwap = () => { toChainId={swapChainId} /> { - const router = useRouter() - - useEffect(() => { - segmentAnalyticsEvent(`[Teaser] arrives`, { - query: router.query, - pathname: router.pathname, - }) - }, []) - - return ( - - - - - ) -} - -export default LandingPage diff --git a/packages/synapse-interface/pages/teaser/FauxBridge.tsx b/packages/synapse-interface/pages/teaser/FauxBridge.tsx deleted file mode 100644 index 2e7390cb8d..0000000000 --- a/packages/synapse-interface/pages/teaser/FauxBridge.tsx +++ /dev/null @@ -1,248 +0,0 @@ -import PulseDot from '@/components/icons/PulseDot' -import { CHAINS_ARR } from '@/constants/chains' -import * as BRIDGEABLE from '@constants/tokens/bridgeable' -import { TOKENS_SORTED_BY_SWAPABLETYPE } from '@/constants/tokens' -import * as WALLET_ICONS from '@components/WalletIcons' - -const cardStyle = - 'text-black dark:text-white bg-zinc-100 dark:bg-zinc-900/95 p-3 rounded-md border border-zinc-200 dark:border-zinc-800 shadow-xl grid gap-4 max-w-sm' -const sectionStyle = - 'relative bg-zinc-50 dark:bg-zinc-800 rounded-md px-2.5 py-3 grid gap-3 grid-cols-2 border border-zinc-300 dark:border-transparent' -const buttonStyle = - 'rounded px-4 py-1 bg-zinc-100 dark:bg-zinc-700 border border-zinc-200 dark:border-transparent hover:border-zinc-400 hover:dark:border-zinc-500 h-fit mr-1 cursor-pointer focus:border-zinc-400 focus:dark:borer-zinc-500' -const buttonSelectStyle = - 'flex gap-1.5 items-center rounded px-3 py-1.5 bg-inherit dark:bg-zinc-700 border border-zinc-200 dark:border-transparent hover:border-zinc-400 hover:dark:border-zinc-500 active:opacity-70 focus:ring-1 focus:ring-zinc-500 focus:border-transparent' -const inputWrapperStyle = - 'relative flex bg-white dark:bg-inherit border border-zinc-200 dark:border-zinc-700 rounded-md gap-0 p-1.5 col-span-2 gap-1.5 items-center' -const inputStyle = - 'bg-inherit border-none w-full p-1.5 text-xxl font-normal dark:font-light tracking-wide rounded' - -export default () => { - return ( -
    -
    - - - -
    - -
    - - -
    - - -
    - ) -} - -const Select = ({ - type, - data, -}: { - type: 'Chain' | 'Token' - data: 'volume' | 'count' -}) => { - let button: string - let header: string - let value: number - let reduce: Function - let format: Function - switch (data) { - case 'volume': - button = `Volume by ${type}` - header = '$ vol.' - value = 1000000000 + Math.random() * 100000000 - reduce = () => (value *= 0.85) - format = () => { - if (value >= 1000000) return '$' + (value / 1000000).toFixed(1) + 'M' - let str = value.toFixed(0) - if (value >= 1000) { - for (let i = 3; i < str.length; i += 4) - str = `${str.slice(0, str.length - i)},${str.slice(-i)}` - return '$' + str - } - return '$' + value.toFixed(2) - } - break - case 'count': - button = `Txns by ${type}` - header = 'Txns' - value = 10000 + Math.random() * 1000 - reduce = () => (value *= 0.9) - format = () => { - let str = value.toFixed() - for (let i = 3; i < str.length; i += 4) - str = `${str.slice(0, str.length - i)},${str.slice(-i)}` - return str - } - break - } - - let arr - let key: string - let img: string - let name: string - - switch (type) { - case 'Chain': - arr = CHAINS_ARR - key = 'id' - img = 'chainImg' - name = 'name' - break - case 'Token': - arr = Object.values(BRIDGEABLE) - key = 'name' - img = 'icon' - name = 'symbol' - break - } - - return ( -
    - -
    - - - - - - - - - {arr.map((item, i) => { - reduce() - return ( - - - - - ) - })} - - -
    - {type} - - {header} -
    - - {item[name]} - {format()}
    -
    -
    - ) -} - -const SupportedWallets = () => ( -
    -
    -
    Supported wallets
    -
      - {Object.values(WALLET_ICONS).map((icon, i) => ( -
    • {icon({ width: 24, height: 24 })}
    • - ))} -
    -
    - -
    -) - -const HistoricMax = () => ( - -) - -const RightAngle = ({ height }) => { - const width = height / 2 - return ( - - - - ) -} - -const BridgeButton = () => ( - -) \ No newline at end of file diff --git a/packages/synapse-interface/pages/teaser/Hero.tsx b/packages/synapse-interface/pages/teaser/Hero.tsx deleted file mode 100644 index a92906294f..0000000000 --- a/packages/synapse-interface/pages/teaser/Hero.tsx +++ /dev/null @@ -1,153 +0,0 @@ -import { useEffect, useRef, useState } from 'react' - -export default function Hero() { - const [h1, setH1] = useState<[cta: string] | [cta: string, index: number]>([ - 'default', - ]) - - const bridgeRef = useRef(null) - const buildRef = useRef(null) - - const [cta, index] = h1 - - const ctas = { - default: { - tag: 'Synapse 2.0: The Modular Interchain Network', - }, - bridge: { - tag: 'Any asset to any chain', - url: '#', - }, - build: { - tag: 'Custom everything', - url: '#', - }, - } - - const { tag, url } = ctas[cta] - - const sleep = (time) => new Promise((resolve) => setTimeout(resolve, time)) - - useEffect(() => { - if (index < tag.length) { - sleep((index / tag.length) * 5 + 5).then(() => setH1([cta, +index + 1])) - } else { - bridgeRef?.current?.addEventListener( - 'mousemove', - () => setH1(['bridge', 0]), - { once: true } - ) - - buildRef?.current?.addEventListener( - 'mousemove', - () => setH1(['build', 0]), - { once: true } - ) - } - - if (cta !== 'default') { - document.addEventListener('mousemove', () => setH1(['default', 0]), { - once: true, - }) - } - }) - - const Tagline = () => { - return ( - <> - {tag.slice(0, index)} - {index < tag.length - 4 && ( - - {String.fromCharCode(Math.random() * 61 + 65)} - - )} - {index < tag.length - 5 && ( - _ - )} - - ) - } - - const ctaButtonBaseStyle = - 'px-5 pt-1.5 pb-2 text-lg m-2 border rounded inline-block' - - return ( -
    -
    - Modular Interchain Messages -
    - -

    - Say goodbye to centralized resource pools for cross-chain communication. - Synapse lets you customize literally every aspect of your interchain - communications. -

    -
    - ) -} - -const ArrowBounce = () => ( - - - - - -) diff --git a/packages/synapse-interface/pages/teaser/ValueProps.tsx b/packages/synapse-interface/pages/teaser/ValueProps.tsx deleted file mode 100644 index 26323d5cd0..0000000000 --- a/packages/synapse-interface/pages/teaser/ValueProps.tsx +++ /dev/null @@ -1,231 +0,0 @@ -import FauxBridge from './FauxBridge' - -export default function ValueProps() { - return ( -
    -
    - {/*
    -
    - Bridge volume -
    -
    - $ - - 45.3 - - B -
    -
    - Transactions -
    -
    - - 10.6 - - M -
    -
    - Total value locked -
    -
    - $ - - 116.7 - - M -
    -
    */} -
      -
    • - $45.3B Bridge volume -
    • -
    • - 10.6M transactions -
    • -
    • - $116.7M Total value locked -
    • -
    - {/*
      -
    • 50 blockchains
    • -
    • 50,000 validators
    • -
    • 10.2B messages
    • -
    • $1.2B transferred
    • -
    */} -
    -
    -
    - - - - - - - - - - - -
    -
    -

    Reach every user

    -

    - Synapse enables developers to build truly native cross-chain - applications with an economically secure method to reach consensus - on interchain transactions, -

    -
    -
    - {/*
    -
      -
    • -

      Extensible

      -

      - Synapse’s cross-chain messaging contracts can be deployed across - any blockchain -

      -
    • -
    • -

      Secure

      -

      - Synapse employs an Optimistic security model to ensure integrity - of cross-chain messages -

      -
    • -
    • -

      Generalized

      -

      - Any arbitrary data can be sent across chains including contract - calls, NFTs, snapshots, and more -

      -
    • -
    -
    */} -
    -
    -

    - Build powerful decentralized apps -

    -

    - Synapse Bridge is built on top of the cross-chain infrastructure - enabling users to seamlessly transfer assets across all blockchains. - The Bridge has become the most widely-used method to move assets - cross-chain, offering low cost, fast, and secure bridging. -

    -
    -
    - -
    -
    - {/*
    -
      -
    • -

      Deep Liquidity

      -

      - Swap native assets using our cross-chain AMM liquidity pools -

      -
    • -
    • -

      Wide Support

      -

      - Access over 16 different EVM and non-EVM blockchains with more - integrations coming soon -

      -
    • -
    • -

      Developer Friendly

      -

      - Easily integrate cross-chain token bridging natively into your - decentralized application -

      -
    • -
    -
    */} - {/*
    -
    -

    Widely Integrated

    -

    - Synapse is widely integrated across the most-used Layer 1 & 2 - networks for a seamless cross-chain experience. -

    -
    -
      - {ChainList().map((a) => { - return ( -
    • - {a} -
    • - ) - })} -
    -
    */} -
    -
    - - - -
    -
    -

    Secure your routes

    -

    - Synapse has processed millions of transactions and tens of billions - in bridged assets. -

    -
    -
    -
    - ) -} - -/* -if (theme) { - formStyle = `p-3 rounded-md border shadow-sm grid gap-4 absolute w-96 ${ - theme === 'dark' - ? 'text-white bg-zinc-900 border-zinc-800 mr-8 mt-8' - : 'text-black bg-neutral-100 border-zinc-300 ml-8 mb-8' - }` - sectionStyle = `rounded px-2.5 py-3 grid gap-3 grid-cols-2 ${ - theme === 'dark' ? 'bg-zinc-800' : 'bg-zinc-50 border border-zinc-200' - }` - selectStyle = `rounded w-fit cursor-pointer border ${ - theme === 'dark' - ? 'bg-zinc-700 border-transparent' - : 'bg-inherit border-zinc-300' - }` - inputWrapperStyle = `flex border rounded-md p-1.5 col-span-2 gap-1.5 ${ - theme === 'dark' - ? 'bg-inherit border-zinc-700' - : 'bg-white border-zinc-200 ' - }` - inputStyle = `bg-inherit border-none w-full p-1.5 text-xxl font-normal tracking-wide rounded ${ - theme === 'dark' ? 'font-light' : 'font-normal' - }` - } - */ diff --git a/packages/synapse-interface/public/blacklist.json b/packages/synapse-interface/public/blacklist.json index 8c1d739048..594000ff72 100644 --- a/packages/synapse-interface/public/blacklist.json +++ b/packages/synapse-interface/public/blacklist.json @@ -525,6 +525,5 @@ "0xff7009d8310396FebE63C3D253D5a390aaf295F2", "0x5E670A679E3ae2778D16614E3E54FF9DbF6a5094", "0x3a378daC2e05D437CA8dCd9C64eA7a3758053cF4", - "0x9e634c91366AfA315e498dA365dD98906754d7d1", - "0xE000008459b74a91e306a47C808061DFA372000E" + "0x9e634c91366AfA315e498dA365dD98906754d7d1" ] diff --git a/packages/synapse-interface/public/pauses/v1/paused-chains.json b/packages/synapse-interface/public/pauses/v1/paused-chains.json index f341c696e9..a464b89851 100644 --- a/packages/synapse-interface/public/pauses/v1/paused-chains.json +++ b/packages/synapse-interface/public/pauses/v1/paused-chains.json @@ -22,10 +22,10 @@ "pausedToChains": [7700], "pauseBridge": true, "pauseSwap": true, - "startTimePauseChain": "2024-08-15T17:35:00Z", - "endTimePauseChain": "2024-08-16T17:35:00Z", - "startTimeBanner": "2024-08-15T17:35:00Z", - "endTimeBanner": "2024-08-16T17:35:00Z", + "startTimePauseChain": "2024-08-20T17:35:00Z", + "endTimePauseChain": "2024-08-31T17:35:00Z", + "startTimeBanner": "2024-08-20T17:35:00Z", + "endTimeBanner": "2024-08-31T17:35:00Z", "inputWarningMessage": "Canto chain paused due to chain instability.", "bannerMessage": "Canto chain currently paused due to chain instability.", "progressBarMessage": "Canto chain paused due to chain instability.", diff --git a/packages/synapse-interface/scripts/data/symbolOverrides.json b/packages/synapse-interface/scripts/data/symbolOverrides.json index df77b5693f..b434da7987 100644 --- a/packages/synapse-interface/scripts/data/symbolOverrides.json +++ b/packages/synapse-interface/scripts/data/symbolOverrides.json @@ -10,5 +10,8 @@ }, "43114": { "0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7": "USDT" + }, + "1088": { + "0x75cb093E4D61d2A2e65D8e0BBb01DE8d89b53481": "WMetis" } } diff --git a/packages/synapse-interface/slices/bridge/reducer.ts b/packages/synapse-interface/slices/bridge/reducer.ts index 2891b5d92f..fa48546045 100644 --- a/packages/synapse-interface/slices/bridge/reducer.ts +++ b/packages/synapse-interface/slices/bridge/reducer.ts @@ -1,8 +1,7 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit' import { type Address } from 'viem' -import { EMPTY_BRIDGE_QUOTE } from '@/constants/bridge' -import { type BridgeQuote, type Token } from '@/utils/types' +import { type Token } from '@/utils/types' import { getRoutePossibilities, getSymbol, @@ -24,11 +23,8 @@ export interface BridgeState { fromTokens: Token[] toTokens: Token[] - fromValue: string debouncedFromValue: string debouncedToTokensFromValue: string - bridgeQuote: BridgeQuote - isLoading: boolean deadlineMinutes: number | null destinationAddress: Address | null } @@ -59,11 +55,8 @@ export const initialState: BridgeState = { fromTokens, toTokens, - fromValue: '', debouncedFromValue: '', debouncedToTokensFromValue: '', - bridgeQuote: EMPTY_BRIDGE_QUOTE, - isLoading: false, deadlineMinutes: null, destinationAddress: null, } @@ -72,9 +65,6 @@ export const bridgeSlice = createSlice({ name: 'bridge', initialState, reducers: { - setIsLoading: (state, action: PayloadAction) => { - state.isLoading = action.payload - }, setFromChainId: (state, action: PayloadAction) => { const incomingFromChainId = action.payload @@ -431,12 +421,6 @@ export const bridgeSlice = createSlice({ state.toChainIds = toChainIds state.toTokens = toTokens }, - setBridgeQuote: (state, action: PayloadAction) => { - state.bridgeQuote = action.payload - }, - updateFromValue: (state, action: PayloadAction) => { - state.fromValue = action.payload - }, updateDebouncedFromValue: (state, action: PayloadAction) => { state.debouncedFromValue = action.payload }, @@ -455,15 +439,11 @@ export const bridgeSlice = createSlice({ clearDestinationAddress: (state) => { state.destinationAddress = initialState.destinationAddress }, - resetBridgeQuote: (state) => { - state.bridgeQuote = initialState.bridgeQuote - }, resetBridgeInputs: (state) => { state.fromChainId = initialState.fromChainId state.fromToken = initialState.fromToken state.toChainId = initialState.toChainId state.toToken = initialState.toToken - state.fromValue = initialState.fromValue state.debouncedFromValue = initialState.debouncedFromValue }, }, @@ -472,16 +452,12 @@ export const bridgeSlice = createSlice({ export const { updateDebouncedFromValue, updateDebouncedToTokensFromValue, - setBridgeQuote, - resetBridgeQuote, setFromChainId, setToChainId, setFromToken, setToToken, - updateFromValue, setDeadlineMinutes, setDestinationAddress, - setIsLoading, resetBridgeInputs, clearDestinationAddress, } = bridgeSlice.actions diff --git a/packages/synapse-interface/slices/bridgeQuote/hooks.ts b/packages/synapse-interface/slices/bridgeQuote/hooks.ts new file mode 100644 index 0000000000..ecc7e9c76e --- /dev/null +++ b/packages/synapse-interface/slices/bridgeQuote/hooks.ts @@ -0,0 +1,6 @@ +import { RootState } from '@/store/store' +import { useAppSelector } from '@/store/hooks' + +export const useBridgeQuoteState = (): RootState['bridgeQuote'] => { + return useAppSelector((state) => state.bridgeQuote) +} diff --git a/packages/synapse-interface/slices/bridgeQuote/reducer.ts b/packages/synapse-interface/slices/bridgeQuote/reducer.ts new file mode 100644 index 0000000000..8407876035 --- /dev/null +++ b/packages/synapse-interface/slices/bridgeQuote/reducer.ts @@ -0,0 +1,49 @@ +import { createSlice, PayloadAction } from '@reduxjs/toolkit' + +import { EMPTY_BRIDGE_QUOTE } from '@/constants/bridge' +import { type BridgeQuote } from '@/utils/types' +import { fetchBridgeQuote } from './thunks' + +export interface BridgeQuoteState { + bridgeQuote: BridgeQuote + isLoading: boolean +} + +export const initialState: BridgeQuoteState = { + bridgeQuote: EMPTY_BRIDGE_QUOTE, + isLoading: false, +} + +export const bridgeQuoteSlice = createSlice({ + name: 'bridgeQuote', + initialState, + reducers: { + setIsLoading: (state, action: PayloadAction) => { + state.isLoading = action.payload + }, + resetBridgeQuote: (state) => { + state.bridgeQuote = initialState.bridgeQuote + }, + }, + extraReducers: (builder) => { + builder + .addCase(fetchBridgeQuote.pending, (state) => { + state.isLoading = true + }) + .addCase( + fetchBridgeQuote.fulfilled, + (state, action: PayloadAction) => { + state.bridgeQuote = action.payload + state.isLoading = false + } + ) + .addCase(fetchBridgeQuote.rejected, (state) => { + state.bridgeQuote = EMPTY_BRIDGE_QUOTE + state.isLoading = false + }) + }, +}) + +export const { resetBridgeQuote, setIsLoading } = bridgeQuoteSlice.actions + +export default bridgeQuoteSlice.reducer diff --git a/packages/synapse-interface/slices/bridgeQuote/thunks.ts b/packages/synapse-interface/slices/bridgeQuote/thunks.ts new file mode 100644 index 0000000000..6a3970cb8b --- /dev/null +++ b/packages/synapse-interface/slices/bridgeQuote/thunks.ts @@ -0,0 +1,191 @@ +import { createAsyncThunk } from '@reduxjs/toolkit' +import { commify } from '@ethersproject/units' +import { Address, zeroAddress } from 'viem' + +import { getErc20TokenAllowance } from '@/actions/getErc20TokenAllowance' +import { AcceptedChainId, CHAINS_BY_ID } from '@/constants/chains' +import { segmentAnalyticsEvent } from '@/contexts/SegmentAnalyticsProvider' +import { stringToBigInt, formatBigIntToString } from '@/utils/bigint/format' +import { calculateExchangeRate } from '@/utils/calculateExchangeRate' +import { getBridgeModuleNames } from '@/utils/getBridgeModuleNames' +import { Token } from '@/utils/types' +import { BridgeModulePause } from '@/components/Maintenance/Maintenance' + +export const fetchBridgeQuote = createAsyncThunk( + 'bridgeQuote/fetchBridgeQuote', + async ( + { + synapseSDK, + fromChainId, + toChainId, + fromToken, + toToken, + debouncedFromValue, + requestId, + currentTimestamp, + address, + pausedModulesList, + }: { + synapseSDK: any + fromChainId: number + toChainId: number + fromToken: Token + toToken: Token + debouncedFromValue: string + requestId: number + currentTimestamp: number + address: Address + pausedModulesList: BridgeModulePause[] + }, + { rejectWithValue } + ) => { + const allQuotes = await synapseSDK.allBridgeQuotes( + fromChainId, + toChainId, + fromToken.addresses[fromChainId], + toToken.addresses[toChainId], + stringToBigInt(debouncedFromValue, fromToken?.decimals[fromChainId]), + { + originUserAddress: address, + } + ) + + const pausedBridgeModules = new Set( + pausedModulesList + .filter((module) => + module.chainId ? module.chainId === fromChainId : true + ) + .flatMap(getBridgeModuleNames) + ) + const activeQuotes = allQuotes.filter( + (quote) => !pausedBridgeModules.has(quote.bridgeModuleName) + ) + + if (activeQuotes.length === 0) { + const msg = `No route found for bridging ${debouncedFromValue} ${fromToken?.symbol} on ${CHAINS_BY_ID[fromChainId]?.name} to ${toToken?.symbol} on ${CHAINS_BY_ID[toChainId]?.name}` + return rejectWithValue(msg) + } + + const rfqQuote = activeQuotes.find( + (q) => q.bridgeModuleName === 'SynapseRFQ' + ) + + const nonRfqQuote = activeQuotes.find( + (quote) => quote.bridgeModuleName !== 'SynapseRFQ' + ) + + let quote + + if (rfqQuote && nonRfqQuote) { + const rfqMaxAmountOut = BigInt(rfqQuote.maxAmountOut.toString()) + const nonRfqMaxAmountOut = BigInt(nonRfqQuote.maxAmountOut.toString()) + + const allowedPercentileDifference = 30n + const maxDifference = + (nonRfqMaxAmountOut * allowedPercentileDifference) / 100n + + if (rfqMaxAmountOut > nonRfqMaxAmountOut - maxDifference) { + quote = rfqQuote + } else { + quote = nonRfqQuote + + segmentAnalyticsEvent(`[Bridge] use non-RFQ quote over RFQ`, { + bridgeModuleName: nonRfqQuote.bridgeModuleName, + originChainId: fromChainId, + originToken: fromToken.symbol, + originTokenAddress: fromToken.addresses[fromChainId], + destinationChainId: toChainId, + destinationToken: toToken.symbol, + destinationTokenAddress: toToken.addresses[toChainId], + rfqQuoteAmountOut: rfqQuote.maxAmountOut.toString(), + nonRfqMaxAmountOut: nonRfqQuote.maxAmountOut.toString(), + }) + } + } else { + quote = rfqQuote ?? nonRfqQuote + } + + const { + id, + feeAmount, + routerAddress, + maxAmountOut, + originQuery, + destQuery, + estimatedTime, + bridgeModuleName, + gasDropAmount, + originChainId, + destChainId, + } = quote + + if (!(originQuery && maxAmountOut && destQuery && feeAmount)) { + const msg = `No route found for bridging ${debouncedFromValue} ${fromToken?.symbol} on ${CHAINS_BY_ID[fromChainId]?.name} to ${toToken?.symbol} on ${CHAINS_BY_ID[toChainId]?.name}` + return rejectWithValue(msg) + } + + const toValueBigInt = BigInt(maxAmountOut.toString()) ?? 0n + + // Bridge Lifecycle: originToken -> bridgeToken -> destToken + // debouncedFromValue is in originToken decimals + // originQuery.minAmountOut and feeAmount is in bridgeToken decimals + // Adjust feeAmount to be in originToken decimals + const adjustedFeeAmount = + (BigInt(feeAmount) * + stringToBigInt( + `${debouncedFromValue}`, + fromToken?.decimals[fromChainId] + )) / + BigInt(originQuery.minAmountOut) + + const isUnsupported = AcceptedChainId[fromChainId] ? false : true + + const allowance = + fromToken?.addresses[fromChainId] === zeroAddress || + address === undefined || + isUnsupported + ? 0n + : await getErc20TokenAllowance({ + address, + chainId: fromChainId, + tokenAddress: fromToken?.addresses[fromChainId] as Address, + spender: routerAddress, + }) + + const { + originQuery: originQueryWithSlippage, + destQuery: destQueryWithSlippage, + } = synapseSDK.applyBridgeSlippage(bridgeModuleName, originQuery, destQuery) + + return { + inputAmountForQuote: debouncedFromValue, + originTokenForQuote: fromToken, + destTokenForQuote: toToken, + outputAmount: toValueBigInt, + outputAmountString: commify( + formatBigIntToString(toValueBigInt, toToken.decimals[toChainId], 8) + ), + routerAddress, + allowance, + exchangeRate: calculateExchangeRate( + stringToBigInt(debouncedFromValue, fromToken?.decimals[fromChainId]) - + BigInt(adjustedFeeAmount), + fromToken?.decimals[fromChainId], + toValueBigInt, + toToken.decimals[toChainId] + ), + feeAmount, + delta: BigInt(maxAmountOut.toString()), + originQuery: originQueryWithSlippage, + destQuery: destQueryWithSlippage, + estimatedTime, + bridgeModuleName, + gasDropAmount: BigInt(gasDropAmount.toString()), + timestamp: currentTimestamp, + originChainId, + destChainId, + requestId, + id, + } + } +) diff --git a/packages/synapse-interface/store/reducer.ts b/packages/synapse-interface/store/reducer.ts index f2d9c3a4e5..f6d940f210 100644 --- a/packages/synapse-interface/store/reducer.ts +++ b/packages/synapse-interface/store/reducer.ts @@ -17,6 +17,7 @@ import poolWithdraw from '@/slices/poolWithdrawSlice' import priceData from '@/slices/priceDataSlice' import gasData from '@/slices/gasDataSlice' import wallet from '@/slices/wallet/reducer' +import bridgeQuote from '@/slices/bridgeQuote/reducer' import { api } from '@/slices/api/slice' import { RootActions } from '@/slices/application/actions' @@ -48,6 +49,7 @@ export const appReducer = combineReducers({ priceData, gasData, wallet, + bridgeQuote, [api.reducerPath]: api.reducer, ...persistedReducers, }) diff --git a/packages/synapse-interface/store/store.ts b/packages/synapse-interface/store/store.ts index db96e735d7..70f5515a6f 100644 --- a/packages/synapse-interface/store/store.ts +++ b/packages/synapse-interface/store/store.ts @@ -45,6 +45,7 @@ let previousState = store.getState() store.subscribe(() => { const currentState = store.getState() const bridgeState = currentState.bridge + const bridgeQuoteState = currentState.bridgeQuote const address = currentState.application?.lastConnectedAddress @@ -53,13 +54,14 @@ store.subscribe(() => { if ( !_.isEqual( - previousState.bridge.bridgeQuote, - currentState.bridge.bridgeQuote + previousState.bridgeQuote.bridgeQuote, + currentState.bridgeQuote.bridgeQuote ) && - currentState.bridge.bridgeQuote.outputAmount !== 0n + currentState.bridgeQuote.bridgeQuote.outputAmount !== 0n ) { const { outputAmountString, routerAddress, exchangeRate } = - bridgeState.bridgeQuote + bridgeQuoteState.bridgeQuote + const { fromChainId, toChainId, fromToken, toToken, debouncedFromValue } = bridgeState @@ -74,7 +76,7 @@ store.subscribe(() => { outputAmountString, routerAddress, exchangeRate: BigInt(exchangeRate.toString()), - bridgeQuote: currentState.bridge.bridgeQuote, + bridgeQuote: currentState.bridgeQuote.bridgeQuote, } segmentAnalyticsEvent(eventTitle, eventData) } diff --git a/packages/synapse-interface/utils/convertUuidToUnix.ts b/packages/synapse-interface/utils/convertUuidToUnix.ts new file mode 100644 index 0000000000..f78b07855d --- /dev/null +++ b/packages/synapse-interface/utils/convertUuidToUnix.ts @@ -0,0 +1,22 @@ +import { UUID } from 'uuidv7' + +export const convertUuidToUnix = (uuid: string) => { + try { + const timestampBytes = new Uint8Array(8) + timestampBytes.set( + new Uint8Array(UUID.parse(uuid).bytes.buffer.slice(0, 6)), + 2 + ) + const timestampMs = new DataView(timestampBytes.buffer).getBigUint64( + 0, + false + ) + + const unixTimestamp = Number(timestampMs) / 1000 + + return unixTimestamp + } catch (e) { + console.error('Invalid uuid', e) + return null + } +} diff --git a/packages/synapse-interface/utils/hooks/useApplicationListener.ts b/packages/synapse-interface/utils/hooks/useApplicationListener.ts index 414554fd77..7239829350 100644 --- a/packages/synapse-interface/utils/hooks/useApplicationListener.ts +++ b/packages/synapse-interface/utils/hooks/useApplicationListener.ts @@ -10,7 +10,7 @@ import { } from '@/slices/application/actions' import { useAppDispatch } from '@/store/hooks' import { isValidAddress, getValidAddress } from '@/utils/isValidAddress' -import { getTimeMinutesBeforeNow } from '@/utils/time' +import { getUnixTimeMinutesBeforeNow } from '@/utils/time' import { resetTransactionsState } from '@/slices/transactions/actions' export const useApplicationListener = () => { @@ -27,7 +27,7 @@ export const useApplicationListener = () => { useEffect(() => { if (lastConnectedTimestamp) { const sevenDaysInSeconds = 7 * 24 * 60 * 60 - const sevenDaysAgo: number = getTimeMinutesBeforeNow(10080) + const sevenDaysAgo: number = getUnixTimeMinutesBeforeNow(10080) if (sevenDaysAgo - lastConnectedTimestamp > sevenDaysInSeconds) { console.log('reset cache from < 7 days stale') @@ -42,9 +42,9 @@ export const useApplicationListener = () => { } dispatch(updateLastConnectedAddress(address)) - dispatch(updateLastConnectedTime(getTimeMinutesBeforeNow(0))) + dispatch(updateLastConnectedTime(getUnixTimeMinutesBeforeNow(0))) } else { - dispatch(updateLastConnectedTime(getTimeMinutesBeforeNow(0))) + dispatch(updateLastConnectedTime(getUnixTimeMinutesBeforeNow(0))) } }, [address, lastConnectedAddress, lastConnectedTimestamp]) diff --git a/packages/synapse-interface/utils/hooks/useBridgeListener.ts b/packages/synapse-interface/utils/hooks/useBridgeListener.ts deleted file mode 100644 index e19fd6f2b9..0000000000 --- a/packages/synapse-interface/utils/hooks/useBridgeListener.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { useEffect } from 'react' - -import { useAppDispatch } from '@/store/hooks' -import { useBridgeState } from '@/slices/bridge/hooks' -import { - BridgeState, - setIsLoading, - initialState, - updateDebouncedFromValue, - updateDebouncedToTokensFromValue, -} from '@/slices/bridge/reducer' - -export const useBridgeListener = () => { - const dispatch = useAppDispatch() - const { fromValue, debouncedFromValue }: BridgeState = useBridgeState() - - /** - * Debounce user input to fetch primary bridge quote (in ms) - * Delay loading animation when user input updates - */ - useEffect(() => { - const DEBOUNCE_DELAY = 300 - const ANIMATION_DELAY = 200 - - const animationTimer = setTimeout(() => { - if (debouncedFromValue !== initialState.debouncedFromValue) { - dispatch(setIsLoading(true)) - } - }, ANIMATION_DELAY) - - const debounceTimer = setTimeout(() => { - dispatch(updateDebouncedFromValue(fromValue)) - }, DEBOUNCE_DELAY) - - return () => { - clearTimeout(debounceTimer) - clearTimeout(animationTimer) - dispatch(setIsLoading(false)) - } - }, [fromValue]) - - // Debounce alternative destination token bridge quotes - useEffect(() => { - const ALTERNATE_OPTIONS_DEBOUNCE_DELAY = 1000 - - const alternativeOptionsDebounceTimer = setTimeout(() => { - dispatch(updateDebouncedToTokensFromValue(debouncedFromValue)) - }, ALTERNATE_OPTIONS_DEBOUNCE_DELAY) - - return () => { - clearTimeout(alternativeOptionsDebounceTimer) - } - }, [debouncedFromValue]) - - return null -} diff --git a/packages/synapse-interface/utils/hooks/useIntervalTimer.ts b/packages/synapse-interface/utils/hooks/useIntervalTimer.ts index c84a5d07e9..2096dfde65 100644 --- a/packages/synapse-interface/utils/hooks/useIntervalTimer.ts +++ b/packages/synapse-interface/utils/hooks/useIntervalTimer.ts @@ -1,6 +1,6 @@ import { useState, useEffect } from 'react' -import { getTimeMinutesFromNow } from '@/utils/time' +import { getUnixTimeMinutesFromNow } from '@/utils/time' /** * Hook for setting an interval based timer @@ -14,14 +14,14 @@ export const useIntervalTimer = ( isDisabled?: boolean ) => { const [currentTime, setCurrentTime] = useState( - getTimeMinutesFromNow(0) + getUnixTimeMinutesFromNow(0) ) /** Update time at set intervals if not disabled */ useEffect(() => { if (!isDisabled) { const interval = setInterval(() => { - const newCurrentTime = getTimeMinutesFromNow(0) + const newCurrentTime = getUnixTimeMinutesFromNow(0) setCurrentTime(newCurrentTime) }, intervalInMs) diff --git a/packages/synapse-interface/utils/hooks/useIsBridgeApproved.ts b/packages/synapse-interface/utils/hooks/useIsBridgeApproved.ts new file mode 100644 index 0000000000..e5124d17b0 --- /dev/null +++ b/packages/synapse-interface/utils/hooks/useIsBridgeApproved.ts @@ -0,0 +1,30 @@ +import { useEffect, useState } from 'react' +import { zeroAddress } from 'viem' + +import { stringToBigInt } from '@/utils/bigint/format' +import { useBridgeState } from '@/slices/bridge/hooks' +import { useBridgeQuoteState } from '@/slices/bridgeQuote/hooks' + +export const useIsBridgeApproved = () => { + const { debouncedFromValue, fromChainId, fromToken } = useBridgeState() + const { bridgeQuote } = useBridgeQuoteState() + + const [isApproved, setIsApproved] = useState(false) + + useEffect(() => { + if (fromToken && fromToken.addresses[fromChainId] === zeroAddress) { + setIsApproved(true) + } else if ( + fromToken && + bridgeQuote?.allowance && + stringToBigInt(debouncedFromValue, fromToken.decimals[fromChainId]) <= + bridgeQuote.allowance + ) { + setIsApproved(true) + } else { + setIsApproved(false) + } + }, [bridgeQuote, fromToken, debouncedFromValue, fromChainId]) + + return isApproved +} diff --git a/packages/synapse-interface/utils/hooks/useStaleQuoteUpdater.ts b/packages/synapse-interface/utils/hooks/useStaleQuoteUpdater.ts index bd0f3b6076..05ccd37dc3 100644 --- a/packages/synapse-interface/utils/hooks/useStaleQuoteUpdater.ts +++ b/packages/synapse-interface/utils/hooks/useStaleQuoteUpdater.ts @@ -4,6 +4,7 @@ import { useEffect, useRef } from 'react' import { BridgeQuote } from '@/utils/types' import { calculateTimeBetween } from '@/utils/time' import { useIntervalTimer } from '@/utils/hooks/useIntervalTimer' +import { convertUuidToUnix } from '@/utils/convertUuidToUnix' /** * Refreshes quotes based on selected stale timeout duration. @@ -14,12 +15,14 @@ export const useStaleQuoteUpdater = ( refreshQuoteCallback: () => Promise, isQuoteLoading: boolean, isWalletPending: boolean, - staleTimeout: number = 15000 // 15_000ms or 15s + staleTimeout: number = 15000 // Default 15_000ms or 15s ) => { - const quoteTime = quote?.timestamp + const eventListenerRef = useRef void)>(null) + + const quoteTime = quote?.id ? convertUuidToUnix(quote?.id) : null const isValidQuote = isNumber(quoteTime) && !isNull(quoteTime) + const currentTime = useIntervalTimer(staleTimeout, !isValidQuote) - const eventListenerRef = useRef void)>(null) useEffect(() => { if (isValidQuote && !isQuoteLoading && !isWalletPending) { diff --git a/packages/synapse-interface/utils/hooks/useTransactionListener.ts b/packages/synapse-interface/utils/hooks/useTransactionListener.ts index 4a14f960fa..e69f70ac87 100644 --- a/packages/synapse-interface/utils/hooks/useTransactionListener.ts +++ b/packages/synapse-interface/utils/hooks/useTransactionListener.ts @@ -15,9 +15,9 @@ import { useLazyGetUserHistoricalActivityQuery } from '@/slices/api/generated' import { useTransactionsState } from '@/slices/transactions/hooks' import { TransactionsState } from '@/slices/transactions/reducer' import { useAppDispatch } from '@/store/hooks' -import { getTimeMinutesBeforeNow, oneMonthInMinutes } from '@/utils/time' +import { getUnixTimeMinutesBeforeNow, oneMonthInMinutes } from '@/utils/time' -const queryHistoricalTime: number = getTimeMinutesBeforeNow(oneMonthInMinutes) +const queryHistoricalTime: number = getUnixTimeMinutesBeforeNow(oneMonthInMinutes) // const queryPendingTime: number = getTimeMinutesBeforeNow(oneDayInMinutes) const POLLING_INTERVAL: number = 300000 // 5 minutes in ms diff --git a/packages/synapse-interface/utils/time.ts b/packages/synapse-interface/utils/time.ts index eeec7d7d9e..8e30b5075a 100644 --- a/packages/synapse-interface/utils/time.ts +++ b/packages/synapse-interface/utils/time.ts @@ -1,13 +1,13 @@ export const oneMonthInMinutes: number = 43200 export const oneDayInMinutes: number = 1440 -export const getTimeMinutesFromNow = (minutesFromNow) => { +export const getUnixTimeMinutesFromNow = (minutesFromNow) => { const currentTimeSeconds = new Date().getTime() / 1000 return Math.round(currentTimeSeconds + 60 * minutesFromNow) } -export const getTimeMinutesBeforeNow = (minutesBeforeNow) => { +export const getUnixTimeMinutesBeforeNow = (minutesBeforeNow) => { const currentTimeSeconds = new Date().getTime() / 1000 return Math.round(currentTimeSeconds - 60 * minutesBeforeNow) diff --git a/packages/synapse-interface/utils/txErrorHandler.tsx b/packages/synapse-interface/utils/txErrorHandler.tsx index c9f7f9d731..eb4a5f1481 100644 --- a/packages/synapse-interface/utils/txErrorHandler.tsx +++ b/packages/synapse-interface/utils/txErrorHandler.tsx @@ -12,8 +12,6 @@ function checkStringForNotEnoughGas(str: string) { } export const txErrorHandler = (err: any) => { - console.log('err from txErrorHandler: ', err) - if (err?.details && checkStringForRejection(err?.details)) { return toast.error('User denied transaction', { id: 'toast-error-user-reject', diff --git a/packages/synapse-interface/utils/types/index.tsx b/packages/synapse-interface/utils/types/index.tsx index e44e870f35..57f0cd8d1c 100644 --- a/packages/synapse-interface/utils/types/index.tsx +++ b/packages/synapse-interface/utils/types/index.tsx @@ -70,6 +70,10 @@ type QuoteQuery = { } export type BridgeQuote = { + id: string + inputAmountForQuote: string + originTokenForQuote: Token + destTokenForQuote: Token outputAmount: bigint outputAmountString: string routerAddress: string @@ -85,6 +89,7 @@ export type BridgeQuote = { timestamp: number originChainId: number destChainId: number + requestId: number } interface TokensByChain { diff --git a/packages/widget/CHANGELOG.md b/packages/widget/CHANGELOG.md index d8ce5b86a4..1acb2dab72 100644 --- a/packages/widget/CHANGELOG.md +++ b/packages/widget/CHANGELOG.md @@ -3,6 +3,57 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.7.0](https://github.com/synapsecns/sanguine/compare/@synapsecns/widget@0.6.10...@synapsecns/widget@0.7.0) (2024-08-27) + + +### Features + +* **widget:** visual update ([#2992](https://github.com/synapsecns/sanguine/issues/2992)) ([8226c60](https://github.com/synapsecns/sanguine/commit/8226c60a5b30b0f977ffef0cdb30c2d01f6ef3b5)), closes [#2993](https://github.com/synapsecns/sanguine/issues/2993) + + + + + +## [0.6.10](https://github.com/synapsecns/sanguine/compare/@synapsecns/widget@0.6.9...@synapsecns/widget@0.6.10) (2024-08-26) + +**Note:** Version bump only for package @synapsecns/widget + + + + + +## [0.6.9](https://github.com/synapsecns/sanguine/compare/@synapsecns/widget@0.6.8...@synapsecns/widget@0.6.9) (2024-08-24) + +**Note:** Version bump only for package @synapsecns/widget + + + + + +## [0.6.8](https://github.com/synapsecns/sanguine/compare/@synapsecns/widget@0.6.7...@synapsecns/widget@0.6.8) (2024-08-23) + +**Note:** Version bump only for package @synapsecns/widget + + + + + +## [0.6.7](https://github.com/synapsecns/sanguine/compare/@synapsecns/widget@0.6.6...@synapsecns/widget@0.6.7) (2024-08-23) + +**Note:** Version bump only for package @synapsecns/widget + + + + + +## [0.6.6](https://github.com/synapsecns/sanguine/compare/@synapsecns/widget@0.6.5...@synapsecns/widget@0.6.6) (2024-08-22) + +**Note:** Version bump only for package @synapsecns/widget + + + + + ## [0.6.5](https://github.com/synapsecns/sanguine/compare/@synapsecns/widget@0.6.4...@synapsecns/widget@0.6.5) (2024-08-08) **Note:** Version bump only for package @synapsecns/widget diff --git a/packages/widget/package.json b/packages/widget/package.json index 9f671981e0..e7662c7ebc 100644 --- a/packages/widget/package.json +++ b/packages/widget/package.json @@ -1,7 +1,7 @@ { "name": "@synapsecns/widget", "description": "Widget library for interacting with the Synapse Protocol", - "version": "0.6.5", + "version": "0.7.0", "license": "MIT", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -18,8 +18,9 @@ }, "homepage": "https://github.com/synapsecns/sanguine/blob/master/packages/widget/README.md", "scripts": { - "build": "rollup -c --bundleConfigAsCjs", - "watch": "rollup -c -w --bundleConfigAsCjs", + "build": "npm run check-token-exports && rollup -c --bundleConfigAsCjs", + "watch": "npm run check-token-exports && rollup -c -w --bundleConfigAsCjs", + "check-token-exports": "node ./src/scripts/check-token-exports.js", "test:coverage": "echo 'No tests defined.'", "lint:check": "eslint . --max-warnings=0", "ci:lint": "npm run lint:check", @@ -67,7 +68,7 @@ "@ethersproject/providers": "^5.7.2", "@ethersproject/units": "^5.7.0", "@reduxjs/toolkit": "^2.0.1", - "@synapsecns/sdk-router": "^0.10.0", + "@synapsecns/sdk-router": "^0.11.0", "ethers": "^6.9.1", "lodash": "^4.17.21", "react-redux": "^9.0.2" diff --git a/packages/widget/src/components/AvailableBalance.tsx b/packages/widget/src/components/AvailableBalance.tsx index 6b52ecf64a..948b38c205 100644 --- a/packages/widget/src/components/AvailableBalance.tsx +++ b/packages/widget/src/components/AvailableBalance.tsx @@ -7,6 +7,8 @@ import { Tooltip } from '@/components/ui/Tooltip' import { useCurrentTokenBalance } from '@/hooks/useCurrentTokenBalance' import { useValidations } from '@/hooks/useValidations' import { useBridgeState } from '@/state/slices/bridge/hooks' +import { useWalletState } from '@/state/slices/wallet/hooks' +import { FetchState } from '@/state/slices/wallet/reducer' export const AvailableBalance = ({ connectedAddress, @@ -19,6 +21,10 @@ export const AvailableBalance = ({ const { originChainId, originToken } = useBridgeState() + const { balancesFetchStatus } = useWalletState() + + const isFetchingBalance = balancesFetchStatus === FetchState.LOADING + const tokenBalance = useCurrentTokenBalance() const { hasEnoughBalance } = useValidations() @@ -45,6 +51,14 @@ export const AvailableBalance = ({ ) } + if (!originChainId) { + return ( +
    + Select source chain +
    + ) + } + return (
    -
    - Available {tokenBalance.parsedBalance ?? '0.0'} -
    + {isFetchingBalance ? ( +
    loading...
    + ) : ( +
    + Available {tokenBalance.parsedBalance ?? '0.0'} +
    + )} {tokenBalance.parsedBalance && !hasEnoughBalance && ( { +export const Receipt = ({ quote, loading, send, receive }) => { const { originChainId, destinationChainId } = useBridgeState() const estTime = useMemo(() => { @@ -19,45 +19,53 @@ export const Receipt = ({ quote, send, receive }) => { } }, [quote]) - return quote.outputAmount ? ( + const isValidQuote = Boolean(quote.outputAmount) + + return (
    - {estTime ? ( + {loading ? ( + <> + fetching... + + ) : isValidQuote ? ( <> {' '} {estTime} via {quote?.bridgeModuleName} {' '} - ) : null} + ) : ( +
    + Powered by  + + Synapse + +
    + )}
    Router
    - {quote?.bridgeModuleName} + {loading ? '...' : isValidQuote ? quote?.bridgeModuleName : '-'}
    Origin
    - {CHAINS_BY_ID[originChainId]?.name} + {originChainId ? CHAINS_BY_ID[originChainId]?.name : '-'}
    Destination
    - {CHAINS_BY_ID[destinationChainId]?.name} + {destinationChainId ? CHAINS_BY_ID[destinationChainId]?.name : '-'}
    Send
    -
    {send}
    +
    {send ? send : '-'}
    Receive
    -
    {receive}
    +
    + {loading ? '...' : isValidQuote ? receive : '-'} +
    - ) : ( -
    - Powered by  - - Synapse - -
    ) } diff --git a/packages/widget/src/components/Widget.tsx b/packages/widget/src/components/Widget.tsx index 2c0a89e035..1b4f41aab0 100644 --- a/packages/widget/src/components/Widget.tsx +++ b/packages/widget/src/components/Widget.tsx @@ -69,6 +69,7 @@ import { findTokenByRouteSymbol } from '@/utils/findTokenByRouteSymbol' import { useMaintenance } from '@/components/Maintenance/Maintenance' import { getTimeMinutesFromNow } from '@/utils/getTimeMinutesFromNow' import { useBridgeQuoteUpdater } from '@/hooks/useBridgeQuoteUpdater' +import { SwitchButton } from '@/components/ui/SwitchButton' interface WidgetProps { customTheme: CustomThemeVariables @@ -422,63 +423,74 @@ export const Widget = ({ > -
    - - -
    - +
    + - -
    -
    -
    - + + +
    + + { + dispatch(setDestinationChainId(originChainId)) + dispatch(setDestinationToken(originToken)) + dispatch(setOriginChainId(destinationChainId)) + dispatch(setOriginToken(destinationToken)) + }} /> - -
    - + + -
    +
    + +
    + { const web3Context = useContext(Web3Context) - const { - web3Provider: { networkId }, - } = web3Context + const { web3Provider } = web3Context || {} + + const networkId = web3Provider?.networkId + const connectedAddress = web3Provider?.connectedAddress return (
  • - ) : ( + ) : connectedAddress ? ( Switch - ))} + ) : null)}
  • ) } diff --git a/packages/widget/src/components/ui/SwitchButton.tsx b/packages/widget/src/components/ui/SwitchButton.tsx new file mode 100644 index 0000000000..b31b455d48 --- /dev/null +++ b/packages/widget/src/components/ui/SwitchButton.tsx @@ -0,0 +1,39 @@ +import { useState } from 'react' + +const ms = 300 + +export const SwitchButton = ({ onClick }: { onClick: () => void }) => { + const [isActive, setIsActive] = useState(false) + + const handleClick = () => { + onClick() + setIsActive(true) + setTimeout(() => setIsActive(false), ms) + } + + return ( + + + + ) +} diff --git a/packages/widget/src/components/ui/TokenOption.tsx b/packages/widget/src/components/ui/TokenOption.tsx index 285789b932..faddbfd9c6 100644 --- a/packages/widget/src/components/ui/TokenOption.tsx +++ b/packages/widget/src/components/ui/TokenOption.tsx @@ -5,11 +5,13 @@ export const TokenOption = ({ onSelect, selected, parsedBalance, + isOrigin, }: { option: BridgeableToken onSelect: (option: BridgeableToken) => void selected: BridgeableToken parsedBalance: string + isOrigin: boolean }) => { return (
  • - Receive + {isOrigin ? null : 'Receive'} )} diff --git a/packages/widget/src/components/ui/TokenPopoverSelect.tsx b/packages/widget/src/components/ui/TokenPopoverSelect.tsx index a9e9ef5390..c1e71615c1 100644 --- a/packages/widget/src/components/ui/TokenPopoverSelect.tsx +++ b/packages/widget/src/components/ui/TokenPopoverSelect.tsx @@ -125,6 +125,7 @@ export const TokenPopoverSelect = ({ onSelect={handleSelect} selected={selected} parsedBalance={option?.parsedBalance} + isOrigin={isOrigin} /> ) )} @@ -146,6 +147,7 @@ export const TokenPopoverSelect = ({ onSelect={handleSelect} selected={selected} parsedBalance={option?.parsedBalance} + isOrigin={isOrigin} /> ) )} diff --git a/packages/widget/src/components/ui/TokenSelect.tsx b/packages/widget/src/components/ui/TokenSelect.tsx index 018c5af6d2..a860b26743 100644 --- a/packages/widget/src/components/ui/TokenSelect.tsx +++ b/packages/widget/src/components/ui/TokenSelect.tsx @@ -106,7 +106,7 @@ export const TokenSelect = ({ label, isOrigin, token, onChange }: Props) => { { onChange(selected) }} diff --git a/packages/widget/src/constants/bridgeMap.ts b/packages/widget/src/constants/bridgeMap.ts index e2ad92cb29..b1fb3a1d35 100644 --- a/packages/widget/src/constants/bridgeMap.ts +++ b/packages/widget/src/constants/bridgeMap.ts @@ -894,6 +894,13 @@ export const BRIDGE_MAP = { destination: ['SYN'], swappable: [], }, + '0x75cb093E4D61d2A2e65D8e0BBb01DE8d89b53481': { + decimals: 18, + symbol: 'WMETIS', + origin: ['Metis'], + destination: ['Metis'], + swappable: [], + }, '0x931B8f17764362A3325D30681009f0eDd6211231': { decimals: 18, symbol: 'nETH', @@ -922,6 +929,13 @@ export const BRIDGE_MAP = { destination: ['nUSD'], swappable: ['0x961318Fc85475E125B99Cc9215f62679aE5200aB'], }, + '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE': { + decimals: 18, + symbol: 'Metis', + origin: ['Metis'], + destination: ['Metis'], + swappable: [], + }, '0xFB21B70922B9f6e3C6274BcD6CB1aa8A0fe20B80': { decimals: 18, symbol: 'gOHM', @@ -1179,6 +1193,13 @@ export const BRIDGE_MAP = { destination: ['JEWEL'], swappable: [], }, + '0x543f1b2176F7E677a95D01ca83551FAa08F83D9F': { + decimals: 18, + symbol: 'Metis', + origin: ['Metis'], + destination: ['Metis'], + swappable: [], + }, '0x5819b6af194A78511c79C85Ea68D2377a7e9335f': { decimals: 18, symbol: 'WKLAY', @@ -1736,6 +1757,13 @@ export const BRIDGE_MAP = { destination: ['nUSD'], swappable: [], }, + '0x43E8E55792D6317328e5c6B0A0C89eF4b8102Fa2': { + decimals: 18, + symbol: 'Metis', + origin: ['Metis'], + destination: ['Metis'], + swappable: [], + }, '0x7516EB8B8Edfa420f540a162335eACF3ea05a247': { decimals: 8, symbol: 'BTC.b', diff --git a/packages/widget/src/constants/bridgeable.ts b/packages/widget/src/constants/bridgeable.ts index 3fc0ac9642..7ef93e50f7 100644 --- a/packages/widget/src/constants/bridgeable.ts +++ b/packages/widget/src/constants/bridgeable.ts @@ -1389,3 +1389,24 @@ export const SPECTRAL: BridgeableToken = { imgUrl: 'https://105bc697.sanguine-fe.pages.dev/_next/static/media/spectral.6d51750c.svg', } + +export const METIS: BridgeableToken = { + priorityRank: 300, + addresses: { + [CHAINS.DFK.id]: '0x43E8E55792D6317328e5c6B0A0C89eF4b8102Fa2', + [CHAINS.KLAYTN.id]: '0x543f1b2176F7E677a95D01ca83551FAa08F83D9F', + [CHAINS.METIS.id]: ZeroAddress, + }, + decimals: { + [CHAINS.DFK.id]: 18, + [CHAINS.KLAYTN.id]: 18, + [CHAINS.METIS.id]: 18, + }, + symbol: 'Metis', + name: 'Metis Token', + swapableType: 'Metis', + color: 'blue', + routeSymbol: 'Metis', + imgUrl: + 'https://7bdf4de3.sanguine-fe.pages.dev/_next/static/media/metis.90b6abf0.svg', +} diff --git a/packages/widget/src/constants/chains.ts b/packages/widget/src/constants/chains.ts index 0d2a0cc1a6..90dfe48e63 100644 --- a/packages/widget/src/constants/chains.ts +++ b/packages/widget/src/constants/chains.ts @@ -264,7 +264,7 @@ export const METIS: Chain = { explorerName: 'Metis Explorer', blockTime: 4000, imgUrl: - 'https://45a97b3d.sanguine-fe.pages.dev/_next/static/media/metis.3114f675.svg', + 'https://7bdf4de3.sanguine-fe.pages.dev/_next/static/media/metis.90b6abf0.svg', networkName: 'Metis Andromeda Mainnet', networkUrl: 'https://andromeda.metis.io/?owner=1088', nativeCurrency: { diff --git a/packages/widget/src/constants/explorer.ts b/packages/widget/src/constants/explorer.ts index 402a366ce9..1b3e946f13 100644 --- a/packages/widget/src/constants/explorer.ts +++ b/packages/widget/src/constants/explorer.ts @@ -18,6 +18,9 @@ export const ExplorerLinks = { 1285: 'https://moonriver.moonscan.io', 2000: 'https://explorer.dogechain.dog', 8453: 'https://basescan.org', + 81457: 'https://blastscan.io', + 534352: 'https://scrollscan.com', + 59144: 'https://lineascan.build', } export const ExplorerNames = { @@ -40,4 +43,7 @@ export const ExplorerNames = { 1285: 'Moonriver Explorer', 2000: 'Dogechain Explorer', 8453: 'BaseScan', + 81457: 'Blastscan', + 534352: 'Scrollscan', + 59144: 'LineaScan', } diff --git a/packages/widget/src/hooks/useCurrentTokenBalance.ts b/packages/widget/src/hooks/useCurrentTokenBalance.ts index e025e08d4e..430ea8f254 100644 --- a/packages/widget/src/hooks/useCurrentTokenBalance.ts +++ b/packages/widget/src/hooks/useCurrentTokenBalance.ts @@ -12,7 +12,7 @@ export const useCurrentTokenBalance = () => { const { balances } = useWalletState() return useMemo(() => { - if (!Array.isArray(balances) || !originToken) { + if (!Array.isArray(balances) || !originToken || !originChainId) { return { rawBalance: null, parsedBalance: null, diff --git a/packages/widget/src/index.tsx b/packages/widget/src/index.tsx index e6939e2ede..a27c5dca19 100644 --- a/packages/widget/src/index.tsx +++ b/packages/widget/src/index.tsx @@ -74,6 +74,7 @@ export const L2DAO = BRIDGEABLE.L2DAO export const LINK = BRIDGEABLE.LINK export const LUSD = BRIDGEABLE.LUSD export const MATIC = BRIDGEABLE.MATIC +export const METIS = BRIDGEABLE.METIS export const METISUSDC = BRIDGEABLE.METISUSDC export const MOVR = BRIDGEABLE.MOVR export const NETH = BRIDGEABLE.NETH diff --git a/packages/widget/src/scripts/check-token-exports.js b/packages/widget/src/scripts/check-token-exports.js new file mode 100644 index 0000000000..192328c322 --- /dev/null +++ b/packages/widget/src/scripts/check-token-exports.js @@ -0,0 +1,42 @@ +const fs = require('fs') +const path = require('path') + +// Tokens to exclude from the check (tokens that are in bridgeable but not exported) +const excludedTokens = ['USDB', 'SPECTRAL'] + +const packageExportContent = fs.readFileSync( + path.join(__dirname, '../../src', 'index.tsx'), + 'utf8' +) +const bridgeableFileContent = fs.readFileSync( + path.join(__dirname, '../../src', 'constants', 'bridgeable.ts'), + 'utf8' +) + +// Extract token names from bridgeable file +const bridgeableTokens = bridgeableFileContent + .match(/export const (\w+):/g) + .map((match) => match.split(' ')[2].replace(':', '')) + +// Extract exported token names from main package export file +const exportedTokens = packageExportContent + .match(/export const (\w+) = BRIDGEABLE\.\1/g) + .map((match) => match.split(' ')[2]) + +// Find tokens that are in BRIDGEABLE but not exported in the main file, excluding specified tokens +const missingExports = bridgeableTokens.filter( + (token) => !exportedTokens.includes(token) && !excludedTokens.includes(token) +) + +if (missingExports.length > 0) { + console.log( + 'The following tokens are in bridgeable.ts but not exported in the main file:' + ) + missingExports.forEach((token) => console.log(token)) + process.exit(1) +} else { + console.log( + 'All required tokens from bridgeable.ts are correctly exported in the main file.' + ) + process.exit(0) +} diff --git a/packages/widget/src/state/slices/wallet/reducer.ts b/packages/widget/src/state/slices/wallet/reducer.ts index 6548f3ace7..323cf108dc 100644 --- a/packages/widget/src/state/slices/wallet/reducer.ts +++ b/packages/widget/src/state/slices/wallet/reducer.ts @@ -12,17 +12,21 @@ export enum FetchState { export interface WalletState { balances: TokenBalance[] + balancesFetchStatus: FetchState + balancesFetchError?: any allowance: string - status: FetchState - error?: any + allowancesFetchStatus: FetchState + allowancesFetchError?: any isWalletPending: boolean } const initialState: WalletState = { balances: [], + balancesFetchStatus: FetchState.IDLE, + balancesFetchError: null, allowance: null, - status: FetchState.IDLE, - error: null, + allowancesFetchStatus: FetchState.IDLE, + allowancesFetchError: null, isWalletPending: false, } @@ -38,36 +42,36 @@ export const walletSlice = createSlice({ builder .addCase(fetchAndStoreTokenBalances.pending, (state) => { state.balances = [] - state.status = FetchState.LOADING - state.error = null + state.balancesFetchStatus = FetchState.LOADING + state.balancesFetchError = null }) .addCase( fetchAndStoreTokenBalances.fulfilled, (state, action: PayloadAction) => { state.balances = action.payload - state.status = FetchState.VALID - state.error = null + state.balancesFetchStatus = FetchState.VALID + state.balancesFetchError = null } ) .addCase(fetchAndStoreTokenBalances.rejected, (state, action) => { - state.error = action.payload - state.status = FetchState.INVALID + state.balancesFetchError = action.payload + state.balancesFetchStatus = FetchState.INVALID }) .addCase(fetchAndStoreAllowance.pending, (state) => { - state.status = FetchState.LOADING - state.error = null + state.allowancesFetchStatus = FetchState.LOADING + state.allowancesFetchError = null }) .addCase( fetchAndStoreAllowance.fulfilled, (state, action: PayloadAction) => { state.allowance = action.payload - state.status = FetchState.VALID - state.error = null + state.allowancesFetchStatus = FetchState.VALID + state.allowancesFetchError = null } ) .addCase(fetchAndStoreAllowance.rejected, (state, action) => { - state.error = action.payload - state.status = FetchState.INVALID + state.allowancesFetchError = action.payload + state.allowancesFetchStatus = FetchState.INVALID }) }, }) diff --git a/packages/widget/src/utils/actions/switchNetwork.ts b/packages/widget/src/utils/actions/switchNetwork.ts index a9819eb445..42eee939e5 100644 --- a/packages/widget/src/utils/actions/switchNetwork.ts +++ b/packages/widget/src/utils/actions/switchNetwork.ts @@ -19,6 +19,7 @@ export const switchNetwork = async (chainId: number, provider: any) => { chainName: chain.networkName, nativeCurrency: chain.nativeCurrency, rpcUrls: [chain.networkUrl], + blockExplorerUrls: [chain.explorerUrl], }, ]) await provider.send('wallet_switchEthereumChain', [{ chainId: hexChainId }]) diff --git a/services/cctp-relayer/go.mod b/services/cctp-relayer/go.mod index 871d372d54..420d5e40c9 100644 --- a/services/cctp-relayer/go.mod +++ b/services/cctp-relayer/go.mod @@ -23,7 +23,7 @@ require ( github.com/urfave/cli/v2 v2.27.2 go.opentelemetry.io/otel v1.28.0 go.opentelemetry.io/otel/trace v1.28.0 - golang.org/x/sync v0.7.0 + golang.org/x/sync v0.8.0 google.golang.org/grpc v1.64.0 gopkg.in/yaml.v2 v2.4.0 gorm.io/driver/mysql v1.5.6 @@ -188,7 +188,7 @@ require ( github.com/lmittmann/w3 v0.10.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.15 // indirect + github.com/mattn/go-runewidth v0.0.16 // indirect github.com/mattn/go-sqlite3 v2.0.3+incompatible // indirect github.com/mattn/go-tty v0.0.3 // indirect github.com/miguelmota/go-ethereum-hdwallet v0.1.1 // indirect @@ -275,16 +275,16 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/arch v0.8.0 // indirect - golang.org/x/crypto v0.24.0 // indirect - golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect - golang.org/x/mod v0.19.0 // indirect - golang.org/x/net v0.26.0 // indirect + golang.org/x/crypto v0.26.0 // indirect + golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 // indirect + golang.org/x/mod v0.20.0 // indirect + golang.org/x/net v0.28.0 // indirect golang.org/x/oauth2 v0.21.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/term v0.21.0 // indirect - golang.org/x/text v0.16.0 // indirect + golang.org/x/sys v0.24.0 // indirect + golang.org/x/term v0.23.0 // indirect + golang.org/x/text v0.17.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.22.0 // indirect + golang.org/x/tools v0.24.0 // indirect google.golang.org/api v0.183.0 // indirect google.golang.org/genproto v0.0.0-20240528184218-531527333157 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect diff --git a/services/cctp-relayer/go.sum b/services/cctp-relayer/go.sum index 2934437afd..058f595a33 100644 --- a/services/cctp-relayer/go.sum +++ b/services/cctp-relayer/go.sum @@ -790,8 +790,8 @@ github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= -github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= +github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U= github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= @@ -1224,8 +1224,8 @@ golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2Uz golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1239,8 +1239,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 h1:yixxcjnhBmY0nkL253HFVIm0JsFHwrHdT3Yh6szTnfY= -golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8/go.mod h1:jj3sYF3dwk5D+ghuXyeI3r5MFf+NT2An6/9dOA95KSI= +golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 h1:kx6Ds3MlpiUHKj7syVnbp57++8WpuKPcR5yjLBjvLEA= +golang.org/x/exp v0.0.0-20240823005443-9b4947da3948/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -1269,8 +1269,8 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= -golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= +golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1327,8 +1327,8 @@ golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1353,8 +1353,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1447,8 +1447,8 @@ golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1458,8 +1458,8 @@ golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= +golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1475,8 +1475,8 @@ golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1547,8 +1547,8 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= -golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/services/explorer/go.mod b/services/explorer/go.mod index 94e0abca2d..d3b0201244 100644 --- a/services/explorer/go.mod +++ b/services/explorer/go.mod @@ -46,7 +46,7 @@ require ( go.opentelemetry.io/otel v1.28.0 go.opentelemetry.io/otel/metric v1.28.0 go.uber.org/atomic v1.11.0 - golang.org/x/sync v0.7.0 + golang.org/x/sync v0.8.0 gopkg.in/yaml.v2 v2.4.0 gorm.io/driver/clickhouse v0.6.1 gorm.io/gorm v1.25.10 @@ -192,7 +192,7 @@ require ( github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.15 // indirect + github.com/mattn/go-runewidth v0.0.16 // indirect github.com/mattn/go-sqlite3 v2.0.3+incompatible // indirect github.com/mattn/go-tty v0.0.3 // indirect github.com/miguelmota/go-ethereum-hdwallet v0.1.1 // indirect @@ -278,15 +278,15 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/arch v0.8.0 // indirect - golang.org/x/crypto v0.24.0 // indirect - golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect + golang.org/x/crypto v0.26.0 // indirect + golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 // indirect golang.org/x/image v0.6.0 // indirect - golang.org/x/mod v0.19.0 // indirect - golang.org/x/net v0.26.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/text v0.16.0 // indirect + golang.org/x/mod v0.20.0 // indirect + golang.org/x/net v0.28.0 // indirect + golang.org/x/sys v0.24.0 // indirect + golang.org/x/text v0.17.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.22.0 // indirect + golang.org/x/tools v0.24.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect google.golang.org/grpc v1.64.0 // indirect diff --git a/services/explorer/go.sum b/services/explorer/go.sum index 0b05ed3fdc..837ec3eea5 100644 --- a/services/explorer/go.sum +++ b/services/explorer/go.sum @@ -781,8 +781,8 @@ github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzp github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= -github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= -github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= +github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U= github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= @@ -1209,8 +1209,8 @@ golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1224,8 +1224,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 h1:yixxcjnhBmY0nkL253HFVIm0JsFHwrHdT3Yh6szTnfY= -golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8/go.mod h1:jj3sYF3dwk5D+ghuXyeI3r5MFf+NT2An6/9dOA95KSI= +golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 h1:kx6Ds3MlpiUHKj7syVnbp57++8WpuKPcR5yjLBjvLEA= +golang.org/x/exp v0.0.0-20240823005443-9b4947da3948/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -1258,8 +1258,8 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= -golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= +golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1312,8 +1312,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1338,8 +1338,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1429,16 +1429,16 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= +golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1451,8 +1451,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1523,8 +1523,8 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= -golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/services/omnirpc/go.mod b/services/omnirpc/go.mod index 7bf6613708..6e5cc43575 100644 --- a/services/omnirpc/go.mod +++ b/services/omnirpc/go.mod @@ -46,8 +46,8 @@ require ( go.opentelemetry.io/otel/metric v1.28.0 go.opentelemetry.io/otel/trace v1.28.0 go.uber.org/automaxprocs v1.5.3 - golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 - golang.org/x/sync v0.7.0 + golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 + golang.org/x/sync v0.8.0 gopkg.in/yaml.v3 v3.0.1 k8s.io/apimachinery v0.29.3 ) @@ -177,7 +177,7 @@ require ( github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.15 // indirect + github.com/mattn/go-runewidth v0.0.16 // indirect github.com/mattn/go-tty v0.0.3 // indirect github.com/miguelmota/go-ethereum-hdwallet v0.1.1 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect @@ -257,14 +257,14 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/arch v0.8.0 // indirect - golang.org/x/crypto v0.24.0 // indirect - golang.org/x/mod v0.19.0 // indirect - golang.org/x/net v0.26.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/term v0.21.0 // indirect - golang.org/x/text v0.16.0 // indirect + golang.org/x/crypto v0.26.0 // indirect + golang.org/x/mod v0.20.0 // indirect + golang.org/x/net v0.28.0 // indirect + golang.org/x/sys v0.24.0 // indirect + golang.org/x/term v0.23.0 // indirect + golang.org/x/text v0.17.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.22.0 // indirect + golang.org/x/tools v0.24.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect google.golang.org/grpc v1.64.0 // indirect diff --git a/services/omnirpc/go.sum b/services/omnirpc/go.sum index db5d39387c..ca58c18118 100644 --- a/services/omnirpc/go.sum +++ b/services/omnirpc/go.sum @@ -795,8 +795,8 @@ github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= -github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= +github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U= github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= @@ -1236,8 +1236,8 @@ golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2Uz golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1251,8 +1251,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 h1:yixxcjnhBmY0nkL253HFVIm0JsFHwrHdT3Yh6szTnfY= -golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8/go.mod h1:jj3sYF3dwk5D+ghuXyeI3r5MFf+NT2An6/9dOA95KSI= +golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 h1:kx6Ds3MlpiUHKj7syVnbp57++8WpuKPcR5yjLBjvLEA= +golang.org/x/exp v0.0.0-20240823005443-9b4947da3948/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -1281,8 +1281,8 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= -golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= +golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1338,8 +1338,8 @@ golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1364,8 +1364,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1458,8 +1458,8 @@ golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1469,8 +1469,8 @@ golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= +golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1486,8 +1486,8 @@ golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1558,8 +1558,8 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= -golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/services/rfq/api/rest/server.go b/services/rfq/api/rest/server.go index ccd3dc0c6f..caeb5a6d32 100644 --- a/services/rfq/api/rest/server.go +++ b/services/rfq/api/rest/server.go @@ -274,22 +274,28 @@ func (r *QuoterAPIServer) checkRole(c *gin.Context, destChainID uint32) (address return addressRecovered, err } - hasRole := r.roleCache[destChainID].Get(addressRecovered.Hex()) + // Check and update cache + cachedRoleItem := r.roleCache[destChainID].Get(addressRecovered.Hex()) + var hasRole bool - if hasRole == nil || hasRole.IsExpired() { - has, roleErr := bridge.HasRole(ops, relayerRole, addressRecovered) - if roleErr == nil { - r.roleCache[destChainID].Set(addressRecovered.Hex(), has, cacheInterval) + if cachedRoleItem == nil || cachedRoleItem.IsExpired() { + // Cache miss or expired, check on-chain + hasRole, err = bridge.HasRole(ops, relayerRole, addressRecovered) + if err != nil { + return addressRecovered, fmt.Errorf("unable to check relayer role on-chain: %w", err) } + // Update cache + r.roleCache[destChainID].Set(addressRecovered.Hex(), hasRole, cacheInterval) + } else { + // Use cached value + hasRole = cachedRoleItem.Value() + } - if roleErr != nil { - err = fmt.Errorf("unable to check relayer role on-chain") - return addressRecovered, err - } else if !has { - err = fmt.Errorf("q.Relayer not an on-chain relayer") - return addressRecovered, err - } + // Verify role + if !hasRole { + return addressRecovered, fmt.Errorf("relayer not an on-chain relayer") } + return addressRecovered, nil } diff --git a/services/rfq/api/rest/server_test.go b/services/rfq/api/rest/server_test.go index b98548d107..9fc48ddb51 100644 --- a/services/rfq/api/rest/server_test.go +++ b/services/rfq/api/rest/server_test.go @@ -208,6 +208,50 @@ func (c *ServerSuite) TestPutAndGetQuoteByRelayer() { c.Assert().True(found, "Newly added quote not found") } +func (c *ServerSuite) TestMultiplePutRequestsWithIncorrectAuth() { + // Start the API server in a separate goroutine and wait for it to initialize. + c.startQuoterAPIServer() + + // Create a random wallet for incorrect authorization + randomWallet, err := wallet.FromRandom() + c.Require().NoError(err) + + // Prepare the authorization header with a signed timestamp using the incorrect wallet + header, err := c.prepareAuthHeader(randomWallet) + c.Require().NoError(err) + + // Perform multiple PUT requests to the API server with the incorrect authorization header + for i := 0; i < 3; i++ { + resp, err := c.sendPutQuoteRequest(header) + c.Require().NoError(err) + defer func() { + err = resp.Body.Close() + c.Require().NoError(err) + }() + + // Read the response body + body, err := io.ReadAll(resp.Body) + c.Require().NoError(err) + + // Log the response body for debugging + fmt.Printf("Request %d response: Status: %d, Body: %s\n", i+1, resp.StatusCode, string(body)) + + switch resp.StatusCode { + case http.StatusBadRequest, http.StatusUnauthorized, http.StatusForbidden: + // These are acceptable error status codes for failed authentication + c.Assert().True(true, "Request %d correctly failed with status %d", i+1, resp.StatusCode) + case http.StatusOK: + // The ModifyQuote method returns 200 OK with an empty body on success + c.Assert().Empty(string(body), "Request %d should return an empty body on success", i+1) + + // Since this shouldn't happen with incorrect auth, fail the test + c.Fail("Request %d unexpectedly succeeded, while submitting incorrect authentication", i+1) + default: + c.Fail("Unexpected status code %d for request %d", resp.StatusCode, i+1) + } + } +} + func (c *ServerSuite) TestFilterQuoteAge() { now := time.Now() diff --git a/services/rfq/e2e/rfq_test.go b/services/rfq/e2e/rfq_test.go index d4476693b1..f6c7874ca9 100644 --- a/services/rfq/e2e/rfq_test.go +++ b/services/rfq/e2e/rfq_test.go @@ -1,12 +1,15 @@ package e2e_test import ( + "fmt" "math/big" + "sync" "testing" "time" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" "github.com/stretchr/testify/suite" "github.com/synapsecns/sanguine/core" "github.com/synapsecns/sanguine/core/metrics" @@ -25,6 +28,7 @@ import ( "github.com/synapsecns/sanguine/services/rfq/relayer/service" "github.com/synapsecns/sanguine/services/rfq/testutil" "github.com/synapsecns/sanguine/services/rfq/util" + "golang.org/x/sync/errgroup" ) type IntegrationSuite struct { @@ -468,3 +472,168 @@ func (i *IntegrationSuite) TestDispute() { return result.TxHash == fakeHash && result.Status == guarddb.Disputed && result.TransactionID == txID }) } + +//nolint:gocognit,cyclop +func (i *IntegrationSuite) TestConcurrentBridges() { + // start the relayer and guard + go func() { + _ = i.relayer.Start(i.GetTestContext()) + }() + go func() { + _ = i.guard.Start(i.GetTestContext()) + }() + + // load token contracts + const startAmount = 10000 + const rfqAmount = 10 + opts := i.destBackend.GetTxContext(i.GetTestContext(), nil) + destUSDC, destUSDCHandle := i.cctpDeployManager.GetMockMintBurnTokenType(i.GetTestContext(), i.destBackend) + realStartAmount, err := testutil.AdjustAmount(i.GetTestContext(), big.NewInt(startAmount), destUSDC.ContractHandle()) + i.NoError(err) + realRFQAmount, err := testutil.AdjustAmount(i.GetTestContext(), big.NewInt(rfqAmount), destUSDC.ContractHandle()) + i.NoError(err) + + // add initial usdc to relayer on destination + tx, err := destUSDCHandle.MintPublic(opts.TransactOpts, i.relayerWallet.Address(), realStartAmount) + i.Nil(err) + i.destBackend.WaitForConfirmation(i.GetTestContext(), tx) + i.Approve(i.destBackend, destUSDC, i.relayerWallet) + + // add initial USDC to relayer on origin + optsOrigin := i.originBackend.GetTxContext(i.GetTestContext(), nil) + originUSDC, originUSDCHandle := i.cctpDeployManager.GetMockMintBurnTokenType(i.GetTestContext(), i.originBackend) + tx, err = originUSDCHandle.MintPublic(optsOrigin.TransactOpts, i.relayerWallet.Address(), realStartAmount) + i.Nil(err) + i.originBackend.WaitForConfirmation(i.GetTestContext(), tx) + i.Approve(i.originBackend, originUSDC, i.relayerWallet) + + // add initial USDC to user on origin + tx, err = originUSDCHandle.MintPublic(optsOrigin.TransactOpts, i.userWallet.Address(), realStartAmount) + i.Nil(err) + i.originBackend.WaitForConfirmation(i.GetTestContext(), tx) + i.Approve(i.originBackend, originUSDC, i.userWallet) + + // non decimal adjusted user want amount + // now our friendly user is going to check the quote and send us some USDC on the origin chain. + i.Eventually(func() bool { + // first he's gonna check the quotes. + userAPIClient, err := client.NewAuthenticatedClient(metrics.Get(), i.apiServer, localsigner.NewSigner(i.userWallet.PrivateKey())) + i.NoError(err) + + allQuotes, err := userAPIClient.GetAllQuotes(i.GetTestContext()) + i.NoError(err) + + // let's figure out the amount of usdc we need + for _, quote := range allQuotes { + if common.HexToAddress(quote.DestTokenAddr) == destUSDC.Address() { + destAmountBigInt, _ := new(big.Int).SetString(quote.DestAmount, 10) + if destAmountBigInt.Cmp(realRFQAmount) > 0 { + // we found our quote! + // now we can move on + return true + } + } + } + return false + }) + + _, originFastBridge := i.manager.GetFastBridge(i.GetTestContext(), i.originBackend) + auth := i.originBackend.GetTxContext(i.GetTestContext(), i.userWallet.AddressPtr()) + parser, err := fastbridge.NewParser(originFastBridge.Address()) + i.NoError(err) + + txIDs := [][32]byte{} + txMux := sync.Mutex{} + sendBridgeReq := func(nonce *big.Int) (*types.Transaction, error) { + txMux.Lock() + auth.TransactOpts.Nonce = nonce + defer txMux.Unlock() + tx, err = originFastBridge.Bridge(auth.TransactOpts, fastbridge.IFastBridgeBridgeParams{ + DstChainId: uint32(i.destBackend.GetChainID()), + To: i.userWallet.Address(), + OriginToken: originUSDC.Address(), + SendChainGas: true, + DestToken: destUSDC.Address(), + OriginAmount: realRFQAmount, + DestAmount: new(big.Int).Sub(realRFQAmount, big.NewInt(5_000_000)), + Deadline: new(big.Int).SetInt64(time.Now().Add(time.Hour * 24).Unix()), + }) + if err != nil { + return nil, fmt.Errorf("failed to send bridge request: %w", err) + } + return tx, nil + } + + // send several txs at once and record txids + numTxs := 100 + txIDMux := sync.Mutex{} + g, ctx := errgroup.WithContext(i.GetTestContext()) + for k := 0; k < numTxs; k++ { + nonce := big.NewInt(int64(k)) + g.Go(func() error { + tx, err := sendBridgeReq(nonce) + if err != nil { + return fmt.Errorf("failed to send bridge request: %w", err) + } + + i.originBackend.WaitForConfirmation(ctx, tx) + receipt, err := i.originBackend.TransactionReceipt(ctx, tx.Hash()) + if err != nil { + return fmt.Errorf("failed to get receipt: %w", err) + } + for _, log := range receipt.Logs { + _, parsedEvent, ok := parser.ParseEvent(*log) + if !ok { + continue + } + event, ok := parsedEvent.(*fastbridge.FastBridgeBridgeRequested) + if ok { + txIDMux.Lock() + txIDs = append(txIDs, event.TransactionId) + txIDMux.Unlock() + return nil + } + } + return nil + }) + } + err = g.Wait() + i.NoError(err) + i.Equal(numTxs, len(txIDs)) + + // TODO: this, but cleaner + anvilClient, err := anvil.Dial(i.GetTestContext(), i.originBackend.RPCAddress()) + i.NoError(err) + + go func() { + for { + select { + case <-i.GetTestContext().Done(): + return + case <-time.After(time.Second * 4): + // increase time by 30 mintutes every second, should be enough to get us a fastish e2e test + // we don't need to worry about deadline since we're only doing this on origin + err = anvilClient.IncreaseTime(i.GetTestContext(), 60*30) + i.NoError(err) + + // because can claim works on last block timestamp, we need to do something + err = anvilClient.Mine(i.GetTestContext(), 1) + i.NoError(err) + } + } + }() + + // verify that each tx is relayed + i.Eventually(func() bool { + for _, txID := range txIDs { + result, err := i.store.GetQuoteRequestByID(i.GetTestContext(), txID) + if err != nil { + return false + } + if result.Status <= reldb.ProvePosted { + return false + } + } + return true + }) +} diff --git a/services/rfq/go.mod b/services/rfq/go.mod index 46799246d4..b463b6c502 100644 --- a/services/rfq/go.mod +++ b/services/rfq/go.mod @@ -8,7 +8,7 @@ require ( github.com/Flaque/filet v0.0.0-20201012163910-45f684403088 github.com/alecthomas/assert v1.0.0 github.com/brianvoe/gofakeit/v6 v6.27.0 - github.com/charmbracelet/huh/spinner v0.0.0-20240618200428-90406d79077d + github.com/charmbracelet/huh/spinner v0.0.0-20240821193529-5fd70815c13f github.com/cornelk/hashmap v1.0.8 github.com/dubonzi/otelresty v1.3.0 github.com/ethereum/go-ethereum v1.13.8 @@ -38,8 +38,8 @@ require ( go.opentelemetry.io/otel v1.28.0 go.opentelemetry.io/otel/metric v1.28.0 go.opentelemetry.io/otel/trace v1.28.0 - golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 - golang.org/x/sync v0.7.0 + golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 + golang.org/x/sync v0.8.0 gopkg.in/yaml.v2 v2.4.0 gorm.io/driver/mysql v1.5.6 gorm.io/driver/sqlite v1.5.6 @@ -97,11 +97,11 @@ require ( github.com/c-bata/go-prompt v0.2.6 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/charmbracelet/bubbles v0.18.0 // indirect - github.com/charmbracelet/bubbletea v0.26.5 // indirect - github.com/charmbracelet/lipgloss v0.11.0 // indirect - github.com/charmbracelet/x/ansi v0.1.2 // indirect - github.com/charmbracelet/x/input v0.1.2 // indirect + github.com/charmbracelet/bubbles v0.19.0 // indirect + github.com/charmbracelet/bubbletea v0.27.0 // indirect + github.com/charmbracelet/lipgloss v0.13.0 // indirect + github.com/charmbracelet/x/ansi v0.1.4 // indirect + github.com/charmbracelet/x/input v0.1.3 // indirect github.com/charmbracelet/x/term v0.1.1 // indirect github.com/charmbracelet/x/windows v0.1.2 // indirect github.com/cheekybits/genny v1.0.0 // indirect @@ -219,7 +219,7 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-localereader v0.0.1 // indirect - github.com/mattn/go-runewidth v0.0.15 // indirect + github.com/mattn/go-runewidth v0.0.16 // indirect github.com/mattn/go-sqlite3 v2.0.3+incompatible // indirect github.com/mattn/go-tty v0.0.3 // indirect github.com/miguelmota/go-ethereum-hdwallet v0.1.1 // indirect @@ -308,15 +308,15 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/arch v0.8.0 // indirect - golang.org/x/crypto v0.24.0 // indirect - golang.org/x/mod v0.19.0 // indirect - golang.org/x/net v0.26.0 // indirect + golang.org/x/crypto v0.26.0 // indirect + golang.org/x/mod v0.20.0 // indirect + golang.org/x/net v0.28.0 // indirect golang.org/x/oauth2 v0.21.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/term v0.21.0 // indirect - golang.org/x/text v0.16.0 // indirect + golang.org/x/sys v0.24.0 // indirect + golang.org/x/term v0.23.0 // indirect + golang.org/x/text v0.17.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.22.0 // indirect + golang.org/x/tools v0.24.0 // indirect google.golang.org/api v0.183.0 // indirect google.golang.org/genproto v0.0.0-20240528184218-531527333157 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect diff --git a/services/rfq/go.sum b/services/rfq/go.sum index 967b9089c8..757a4346f2 100644 --- a/services/rfq/go.sum +++ b/services/rfq/go.sum @@ -234,18 +234,18 @@ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/charmbracelet/bubbles v0.18.0 h1:PYv1A036luoBGroX6VWjQIE9Syf2Wby2oOl/39KLfy0= -github.com/charmbracelet/bubbles v0.18.0/go.mod h1:08qhZhtIwzgrtBjAcJnij1t1H0ZRjwHyGsy6AL11PSw= -github.com/charmbracelet/bubbletea v0.26.5 h1:90pqTPElAReb/qQUgSMUresTkfwVr0Wx+zczeHHOgxk= -github.com/charmbracelet/bubbletea v0.26.5/go.mod h1:dz8CWPlfCCGLFbBlTY4N7bjLiyOGDJEnd2Muu7pOWhk= -github.com/charmbracelet/huh/spinner v0.0.0-20240618200428-90406d79077d h1:OpthCCWiHBSx6LTAYGGkN9OeuJrKzjobe0q12wO6BX0= -github.com/charmbracelet/huh/spinner v0.0.0-20240618200428-90406d79077d/go.mod h1:CrXBZnOWs3zpyppOZZS7lu2CpLq2jx6U5chL/frRG/E= -github.com/charmbracelet/lipgloss v0.11.0 h1:UoAcbQ6Qml8hDwSWs0Y1cB5TEQuZkDPH/ZqwWWYTG4g= -github.com/charmbracelet/lipgloss v0.11.0/go.mod h1:1UdRTH9gYgpcdNN5oBtjbu/IzNKtzVtb7sqN1t9LNn8= -github.com/charmbracelet/x/ansi v0.1.2 h1:6+LR39uG8DE6zAmbu023YlqjJHkYXDF1z36ZwzO4xZY= -github.com/charmbracelet/x/ansi v0.1.2/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw= -github.com/charmbracelet/x/input v0.1.2 h1:QJAZr33eOhDowkkEQ24rsJy4Llxlm+fRDf/cQrmqJa0= -github.com/charmbracelet/x/input v0.1.2/go.mod h1:LGBim0maUY4Pitjn/4fHnuXb4KirU3DODsyuHuXdOyA= +github.com/charmbracelet/bubbles v0.19.0 h1:gKZkKXPP6GlDk6EcfujDK19PCQqRjaJZQ7QRERx1UF0= +github.com/charmbracelet/bubbles v0.19.0/go.mod h1:WILteEqZ+krG5c3ntGEMeG99nCupcuIk7V0/zOP0tOA= +github.com/charmbracelet/bubbletea v0.27.0 h1:Mznj+vvYuYagD9Pn2mY7fuelGvP0HAXtZYGgRBCbHvU= +github.com/charmbracelet/bubbletea v0.27.0/go.mod h1:5MdP9XH6MbQkgGhnlxUqCNmBXf9I74KRQ8HIidRxV1Y= +github.com/charmbracelet/huh/spinner v0.0.0-20240821193529-5fd70815c13f h1:i94e1l91SP1q7HAyAaT3pziIGIS1Q/Lvg/gaAWbr2Kc= +github.com/charmbracelet/huh/spinner v0.0.0-20240821193529-5fd70815c13f/go.mod h1:1fSCfCxE3BGKFb3v+ta8bQHC5kcyPUA65zdVWBMzthE= +github.com/charmbracelet/lipgloss v0.13.0 h1:4X3PPeoWEDCMvzDvGmTajSyYPcZM4+y8sCA/SsA3cjw= +github.com/charmbracelet/lipgloss v0.13.0/go.mod h1:nw4zy0SBX/F/eAO1cWdcvy6qnkDUxr8Lw7dvFrAIbbY= +github.com/charmbracelet/x/ansi v0.1.4 h1:IEU3D6+dWwPSgZ6HBH+v6oUuZ/nVawMiWj5831KfiLM= +github.com/charmbracelet/x/ansi v0.1.4/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw= +github.com/charmbracelet/x/input v0.1.3 h1:oy4TMhyGQsYs/WWJwu1ELUMFnjiUAXwtDf048fHbCkg= +github.com/charmbracelet/x/input v0.1.3/go.mod h1:1gaCOyw1KI9e2j00j/BBZ4ErzRZqa05w0Ghn83yIhKU= github.com/charmbracelet/x/term v0.1.1 h1:3cosVAiPOig+EV4X9U+3LDgtwwAoEzJjNdwbXDjF6yI= github.com/charmbracelet/x/term v0.1.1/go.mod h1:wB1fHt5ECsu3mXYusyzcngVWWlu1KKUmmLhfgr/Flxw= github.com/charmbracelet/x/windows v0.1.2 h1:Iumiwq2G+BRmgoayww/qfcvof7W/3uLoelhxojXlRWg= @@ -838,8 +838,8 @@ github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+Ei github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= -github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= +github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U= github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= @@ -1288,8 +1288,8 @@ golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2Uz golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1303,8 +1303,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 h1:yixxcjnhBmY0nkL253HFVIm0JsFHwrHdT3Yh6szTnfY= -golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8/go.mod h1:jj3sYF3dwk5D+ghuXyeI3r5MFf+NT2An6/9dOA95KSI= +golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 h1:kx6Ds3MlpiUHKj7syVnbp57++8WpuKPcR5yjLBjvLEA= +golang.org/x/exp v0.0.0-20240823005443-9b4947da3948/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -1333,8 +1333,8 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= -golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= +golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1392,8 +1392,8 @@ golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1418,8 +1418,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1513,8 +1513,8 @@ golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1524,8 +1524,8 @@ golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= +golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1541,8 +1541,8 @@ golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1613,8 +1613,8 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= -golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/services/rfq/guard/service/guard.go b/services/rfq/guard/service/guard.go index 76796318e1..80b5333cdd 100644 --- a/services/rfq/guard/service/guard.go +++ b/services/rfq/guard/service/guard.go @@ -75,7 +75,7 @@ func NewGuard(ctx context.Context, metricHandler metrics.Handler, cfg guardconfi if err != nil { return nil, fmt.Errorf("could not get deploy block: %w", err) } - chainListener, err := listener.NewChainListener(chainClient, store, common.HexToAddress(rfqAddr), uint64(startBlock.Int64()), metricHandler) + chainListener, err := listener.NewChainListener(chainClient, store, common.HexToAddress(rfqAddr), uint64(startBlock.Int64()), metricHandler, listener.WithName("guard")) if err != nil { return nil, fmt.Errorf("could not get chain listener: %w", err) } diff --git a/services/rfq/relayer/dashboards/dashboard.json b/services/rfq/relayer/dashboards/dashboard.json index 2a2af48804..f0576a82bd 100644 --- a/services/rfq/relayer/dashboards/dashboard.json +++ b/services/rfq/relayer/dashboards/dashboard.json @@ -228,7 +228,7 @@ "uid": "prometheus" }, "editorMode": "code", - "expr": "avg(inventory_balance{token_name=\"USD Coin\",relayer=\"$relayer\"}) by (chain_id)", + "expr": "avg(inventory_balance{token_name=\"USDC\",relayer=\"$relayer\"}) by (chain_id)", "instant": false, "legendFormat": "__auto", "range": true, @@ -323,7 +323,7 @@ "uid": "prometheus" }, "editorMode": "code", - "expr": "avg(quote_amount{origin_token_name=\"ETH\", dest_token_name=\"ETH\"}) by (origin_chain_id, dest_chain_id)", + "expr": "avg(quote_amount{origin_token_name=\"ETH\", dest_token_name=\"ETH\", relayer=\"$relayer\"}) by (origin_chain_id, dest_chain_id)", "instant": false, "legendFormat": "__auto", "range": true, @@ -418,7 +418,7 @@ "uid": "prometheus" }, "editorMode": "code", - "expr": "avg(quote_amount{origin_token_name=\"USD Coin\"} / 1e6) by (origin_chain_id, destination_chain_id)", + "expr": "avg(quote_amount{origin_token_name=\"USDC\", relayer=\"$relayer\"} / 1e6) by (origin_chain_id, destination_chain_id)", "hide": false, "instant": false, "legendFormat": "{{origin_chain_id}} to {{destination_chain_id}} ", @@ -573,6 +573,6 @@ "timezone": "", "title": "RFQ Relayer", "uid": "c394e799-062f-4bfd-90d6-b94f2932575a", - "version": 18, + "version": 22, "weekStart": "" } diff --git a/services/rfq/relayer/relapi/client.go b/services/rfq/relayer/relapi/client.go index f4c690cb89..30ea7edfed 100644 --- a/services/rfq/relayer/relapi/client.go +++ b/services/rfq/relayer/relapi/client.go @@ -15,12 +15,11 @@ import ( // RelayerClient is the interface for the relayer client. type RelayerClient interface { Health(ctx context.Context) (ok bool, err error) - GetQuoteRequestStatusByTxHash(ctx context.Context, hash string) (*GetQuoteRequestStatusResponse, error) - GetQuoteRequestStatusByTxID(ctx context.Context, hash string) (*GetQuoteRequestStatusResponse, error) RetryTransaction(ctx context.Context, txhash string) (*GetTxRetryResponse, error) Withdraw(ctx context.Context, req *WithdrawRequest) (*WithdrawResponse, error) GetTxHashByNonce(ctx context.Context, req *GetTxByNonceRequest) (*TxHashByNonceResponse, error) GetQuoteRequestByTXID(ctx context.Context, txid string) (*GetQuoteRequestResponse, error) + GetQuoteRequestByTxHash(ctx context.Context, txhash string) (*GetQuoteRequestResponse, error) } type relayerClient struct { @@ -55,40 +54,6 @@ func (r *relayerClient) Health(ctx context.Context) (ok bool, err error) { return ok, nil } -func (r *relayerClient) GetQuoteRequestStatusByTxHash(ctx context.Context, hash string) (*GetQuoteRequestStatusResponse, error) { - var res GetQuoteRequestStatusResponse - - resp, err := r.client.R().SetContext(ctx). - SetQueryParam("hash", hash). - SetResult(&res). - Get(getQuoteStatusByTxHashRoute) - if err != nil { - return nil, fmt.Errorf("failed to get quote request status by tx hash: %w", err) - } - if resp.StatusCode() != http.StatusOK { - return nil, fmt.Errorf("unexpected status code: %d", resp.StatusCode()) - } - - return &res, nil -} - -func (r *relayerClient) GetQuoteRequestStatusByTxID(ctx context.Context, txid string) (*GetQuoteRequestStatusResponse, error) { - var res GetQuoteRequestStatusResponse - - resp, err := r.client.R().SetContext(ctx). - SetQueryParam("id", txid). - SetResult(&res). - Get(getQuoteStatusByTxIDRoute) - if err != nil { - return nil, fmt.Errorf("failed to get quote request status by tx hash: %w", err) - } - if resp.StatusCode() != http.StatusOK { - return nil, fmt.Errorf("unexpected status code: %d", resp.StatusCode()) - } - - return &res, nil -} - func (r *relayerClient) RetryTransaction(ctx context.Context, txhash string) (*GetTxRetryResponse, error) { var res GetTxRetryResponse resp, err := r.client.R().SetContext(ctx). @@ -141,7 +106,6 @@ func (r *relayerClient) GetTxHashByNonce(ctx context.Context, req *GetTxByNonceR SetQueryParam("chain_id", fmt.Sprintf("%d", req.ChainID)). SetQueryParam("nonce", fmt.Sprintf("%d", req.Nonce)). Get(getTxHashByNonceRoute) - if err != nil { return nil, fmt.Errorf("failed to get tx hash by nonce: %w", err) } @@ -169,3 +133,20 @@ func (r *relayerClient) GetQuoteRequestByTXID(ctx context.Context, txid string) return &res, nil } + +func (r *relayerClient) GetQuoteRequestByTxHash(ctx context.Context, txHash string) (*GetQuoteRequestResponse, error) { + var res GetQuoteRequestResponse + resp, err := r.client.R().SetContext(ctx). + SetQueryParam("hash", txHash). + SetResult(&res). + Get(getRequestByTxHash) + if err != nil { + return nil, fmt.Errorf("failed to get quote request by tx hash: %w", err) + } + + if resp.StatusCode() != http.StatusOK { + return nil, fmt.Errorf("unexpected status code: %d", resp.StatusCode()) + } + + return &res, nil +} diff --git a/services/rfq/relayer/relapi/client_test.go b/services/rfq/relayer/relapi/client_test.go index c7bffee702..424a678633 100644 --- a/services/rfq/relayer/relapi/client_test.go +++ b/services/rfq/relayer/relapi/client_test.go @@ -26,7 +26,7 @@ func (c *RelayerClientSuite) TestGetQuoteRequestStatusByTxHash() { err := c.underlying.database.StoreQuoteRequest(c.GetTestContext(), testReq) c.Require().NoError(err) - resp, err := c.Client.GetQuoteRequestStatusByTxHash(c.GetTestContext(), testReq.OriginTxHash.String()) + resp, err := c.Client.GetQuoteRequestByTxHash(c.GetTestContext(), testReq.OriginTxHash.String()) c.Require().NoError(err) c.Equal(resp.Status, testReq.Status.String()) @@ -40,7 +40,7 @@ func (c *RelayerClientSuite) TestGetQuoteRequestStatusByTxID() { err := c.underlying.database.StoreQuoteRequest(c.GetTestContext(), testReq) c.Require().NoError(err) - resp, err := c.Client.GetQuoteRequestStatusByTxID(c.GetTestContext(), hexutil.Encode(testReq.TransactionID[:])) + resp, err := c.Client.GetQuoteRequestByTXID(c.GetTestContext(), hexutil.Encode(testReq.TransactionID[:])) c.Require().NoError(err) c.Equal(resp.Status, testReq.Status.String()) @@ -235,7 +235,8 @@ func (c *RelayerClientSuite) TestERC20WithdrawCLI() { c.Require().NoError(err) c.Require().NotNil(res) } -func (c *RelayerClientSuite) TestGetQuoteByTX() { + +func (c *RelayerClientSuite) TestGetQuoteByTxID() { testReq := c.underlying.getTestQuoteRequest(reldb.Seen) err := c.underlying.database.StoreQuoteRequest(c.GetTestContext(), testReq) c.Require().NoError(err) @@ -245,3 +246,14 @@ func (c *RelayerClientSuite) TestGetQuoteByTX() { c.Equal(len(common.Hex2Bytes(resp.QuoteRequestRaw)), len(testReq.RawRequest)) } + +func (c *RelayerClientSuite) TestGetQuoteByTxHash() { + testReq := c.underlying.getTestQuoteRequest(reldb.Seen) + err := c.underlying.database.StoreQuoteRequest(c.GetTestContext(), testReq) + c.Require().NoError(err) + + resp, err := c.Client.GetQuoteRequestByTxHash(c.GetTestContext(), testReq.OriginTxHash.String()) + c.Require().NoError(err) + + c.Equal(len(common.Hex2Bytes(resp.QuoteRequestRaw)), len(testReq.RawRequest)) +} diff --git a/services/rfq/relayer/relapi/handler.go b/services/rfq/relayer/relapi/handler.go index 2c644aee70..ca68a87a48 100644 --- a/services/rfq/relayer/relapi/handler.go +++ b/services/rfq/relayer/relapi/handler.go @@ -51,65 +51,6 @@ func (h *Handler) GetHealth(c *gin.Context) { const unspecifiedTxHash = "Must specify 'hash' (corresponding to origin tx)" -// GetQuoteRequestStatusByTxHash gets the status of a quote request, given an origin tx hash. -func (h *Handler) GetQuoteRequestStatusByTxHash(c *gin.Context) { - txHashStr := c.Query("hash") - if txHashStr == "" { - c.JSON(http.StatusBadRequest, gin.H{"error": unspecifiedTxHash}) - return - } - - txHash := common.HexToHash(txHashStr) - quoteRequest, err := h.db.GetQuoteRequestByOriginTxHash(c, txHash) - if err != nil { - c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()}) - return - } - - resp := GetQuoteRequestStatusResponse{ - Status: quoteRequest.Status.String(), - TxID: hexutil.Encode(quoteRequest.TransactionID[:]), - OriginTxHash: quoteRequest.OriginTxHash.String(), - OriginChainID: quoteRequest.Transaction.OriginChainId, - DestChainID: quoteRequest.Transaction.DestChainId, - DestTxHash: quoteRequest.DestTxHash.String(), - } - c.JSON(http.StatusOK, resp) -} - -// GetQuoteRequestStatusByTxID gets the status of a quote request, given a tx id. -func (h *Handler) GetQuoteRequestStatusByTxID(c *gin.Context) { - txIDStr := c.Query("id") - if txIDStr == "" { - c.JSON(http.StatusBadRequest, gin.H{"error": "Must specify 'id'"}) - return - } - - txIDBytes, err := hexutil.Decode(txIDStr) - if err != nil { - c.JSON(http.StatusBadRequest, gin.H{"error": "Invalid txID"}) - return - } - var txID [32]byte - copy(txID[:], txIDBytes) - - quoteRequest, err := h.db.GetQuoteRequestByID(c, txID) - if err != nil { - c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()}) - return - } - - resp := GetQuoteRequestStatusResponse{ - Status: quoteRequest.Status.String(), - TxID: hexutil.Encode(quoteRequest.TransactionID[:]), - OriginTxHash: quoteRequest.OriginTxHash.String(), - OriginChainID: quoteRequest.Transaction.OriginChainId, - DestChainID: quoteRequest.Transaction.DestChainId, - DestTxHash: quoteRequest.DestTxHash.String(), - } - c.JSON(http.StatusOK, resp) -} - // GetTxRetry retries a transaction based on tx hash. func (h *Handler) GetTxRetry(c *gin.Context) { txHashStr := c.Query("hash") @@ -171,7 +112,42 @@ func (h *Handler) GetQuoteRequestByTxID(c *gin.Context) { } resp := GetQuoteRequestResponse{ + Sender: quoteRequest.Sender.String(), + Status: quoteRequest.Status.String(), + TxID: hexutil.Encode(quoteRequest.TransactionID[:]), + QuoteRequestRaw: common.Bytes2Hex(quoteRequest.RawRequest), + OriginTxHash: quoteRequest.OriginTxHash.String(), + DestTxHash: quoteRequest.DestTxHash.String(), + OriginChainID: quoteRequest.Transaction.OriginChainId, + DestChainID: quoteRequest.Transaction.DestChainId, + OriginToken: quoteRequest.Transaction.OriginToken.Hex(), + DestToken: quoteRequest.Transaction.DestToken.Hex(), + } + c.JSON(http.StatusOK, resp) +} + +// GetQuoteRequestByTxHash gets the quote request by tx hash. +func (h *Handler) GetQuoteRequestByTxHash(c *gin.Context) { + txHashStr := c.Query("hash") + if txHashStr == "" { + c.JSON(http.StatusBadRequest, gin.H{"error": unspecifiedTxHash}) + return + } + + txHash := common.HexToHash(txHashStr) + quoteRequest, err := h.db.GetQuoteRequestByOriginTxHash(c, txHash) + if err != nil { + c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()}) + return + } + + resp := GetQuoteRequestResponse{ + Sender: quoteRequest.Sender.String(), + Status: quoteRequest.Status.String(), + TxID: hexutil.Encode(quoteRequest.TransactionID[:]), QuoteRequestRaw: common.Bytes2Hex(quoteRequest.RawRequest), + OriginTxHash: quoteRequest.OriginTxHash.String(), + DestTxHash: quoteRequest.DestTxHash.String(), OriginChainID: quoteRequest.Transaction.OriginChainId, DestChainID: quoteRequest.Transaction.DestChainId, OriginToken: quoteRequest.Transaction.OriginToken.Hex(), diff --git a/services/rfq/relayer/relapi/model.go b/services/rfq/relayer/relapi/model.go index e84c313983..9615df32f0 100644 --- a/services/rfq/relayer/relapi/model.go +++ b/services/rfq/relayer/relapi/model.go @@ -1,15 +1,5 @@ package relapi -// GetQuoteRequestStatusResponse contains the schema for a GET /quote response. -type GetQuoteRequestStatusResponse struct { - Status string `json:"status"` - TxID string `json:"tx_id"` - OriginTxHash string `json:"origin_tx_hash"` - OriginChainID uint32 `json:"origin_chain_id"` - DestTxHash string `json:"dest_tx_hash"` - DestChainID uint32 `json:"dest_chain_id"` -} - // GetTxRetryResponse contains the schema for a PUT /tx/retry response. type GetTxRetryResponse struct { TxID string `json:"tx_id"` @@ -27,7 +17,12 @@ type PutRelayAckResponse struct { // GetQuoteRequestResponse is the response to a get quote request. type GetQuoteRequestResponse struct { + Sender string `json:"sender"` + Status string `json:"status"` + TxID string `json:"tx_id"` QuoteRequestRaw string `json:"quote_request"` + OriginTxHash string `json:"origin_tx_hash"` + DestTxHash string `json:"dest_tx_hash"` OriginChainID uint32 `json:"origin_chain_id"` DestChainID uint32 `json:"dest_chain_id"` OriginToken string `json:"origin_token"` diff --git a/services/rfq/relayer/relapi/server.go b/services/rfq/relayer/relapi/server.go index b7d80663f6..65fff5ac70 100644 --- a/services/rfq/relayer/relapi/server.go +++ b/services/rfq/relayer/relapi/server.go @@ -95,13 +95,12 @@ func NewRelayerAPI( } const ( - getHealthRoute = "/health" - getQuoteStatusByTxHashRoute = "/status" - getQuoteStatusByTxIDRoute = "/status/by_tx_id" - getRetryRoute = "/retry" - postWithdrawRoute = "/withdraw" - getTxHashByNonceRoute = "/tx_hash/by_nonce" - getRequestByTxID = "/request/by_tx_id" + getHealthRoute = "/health" + getRetryRoute = "/retry" + postWithdrawRoute = "/withdraw" + getTxHashByNonceRoute = "/tx_hash/by_nonce" + getRequestByTxID = "/request/by_tx_id" + getRequestByTxHash = "/request/by_tx_hash" ) var logger = log.Logger("relayer-api") @@ -115,10 +114,9 @@ func (r *RelayerAPIServer) Run(ctx context.Context) error { // Assign GET routes engine.GET(getHealthRoute, h.GetHealth) - engine.GET(getQuoteStatusByTxHashRoute, h.GetQuoteRequestStatusByTxHash) - engine.GET(getQuoteStatusByTxIDRoute, h.GetQuoteRequestStatusByTxID) engine.GET(getRetryRoute, h.GetTxRetry) engine.GET(getRequestByTxID, h.GetQuoteRequestByTxID) + engine.GET(getRequestByTxHash, h.GetQuoteRequestByTxHash) engine.GET(metrics.MetricsPathDefault, gin.WrapH(r.handler.Handler())) if r.cfg.EnableAPIWithdrawals { diff --git a/services/rfq/relayer/relapi/server_test.go b/services/rfq/relayer/relapi/server_test.go index 9d54bcba0c..cde56987af 100644 --- a/services/rfq/relayer/relapi/server_test.go +++ b/services/rfq/relayer/relapi/server_test.go @@ -50,7 +50,7 @@ func (c *RelayerServerSuite) TestGetQuoteRequestByTxHash() { // Fetch the quote request by tx hash client := &http.Client{} - req, err := http.NewRequestWithContext(c.GetTestContext(), http.MethodGet, fmt.Sprintf("http://localhost:%d/status?hash=%s", c.port, quoteRequest.OriginTxHash), nil) + req, err := http.NewRequestWithContext(c.GetTestContext(), http.MethodGet, fmt.Sprintf("http://localhost:%d/request/by_tx_hash?hash=%s", c.port, quoteRequest.OriginTxHash), nil) c.Require().NoError(err) resp, err := client.Do(req) c.Require().NoError(err) @@ -63,16 +63,19 @@ func (c *RelayerServerSuite) TestGetQuoteRequestByTxHash() { c.Equal(http.StatusOK, resp.StatusCode) // Compare to expected result - var result relapi.GetQuoteRequestStatusResponse + var result relapi.GetQuoteRequestResponse err = json.NewDecoder(resp.Body).Decode(&result) c.Require().NoError(err) - expectedResult := relapi.GetQuoteRequestStatusResponse{ - Status: quoteRequest.Status.String(), - TxID: hexutil.Encode(quoteRequest.TransactionID[:]), - OriginTxHash: quoteRequest.OriginTxHash.String(), - OriginChainID: quoteRequest.Transaction.OriginChainId, - DestChainID: quoteRequest.Transaction.DestChainId, - DestTxHash: quoteRequest.DestTxHash.String(), + expectedResult := relapi.GetQuoteRequestResponse{ + Status: quoteRequest.Status.String(), + TxID: hexutil.Encode(quoteRequest.TransactionID[:]), + QuoteRequestRaw: result.QuoteRequestRaw, + OriginTxHash: quoteRequest.OriginTxHash.String(), + DestTxHash: quoteRequest.DestTxHash.String(), + OriginChainID: quoteRequest.Transaction.OriginChainId, + DestChainID: quoteRequest.Transaction.DestChainId, + OriginToken: quoteRequest.Transaction.OriginToken.String(), + DestToken: quoteRequest.Transaction.DestToken.String(), } c.Equal(expectedResult, result) c.GetTestContext().Done() @@ -89,7 +92,7 @@ func (c *RelayerServerSuite) TestGetQuoteRequestByTxID() { // Fetch the quote request by tx hash client := &http.Client{} txIDStr := hexutil.Encode(quoteRequest.TransactionID[:]) - req, err := http.NewRequestWithContext(c.GetTestContext(), http.MethodGet, fmt.Sprintf("http://localhost:%d/status/by_tx_id?id=%s", c.port, txIDStr), nil) + req, err := http.NewRequestWithContext(c.GetTestContext(), http.MethodGet, fmt.Sprintf("http://localhost:%d/request/by_tx_id?id=%s", c.port, txIDStr), nil) c.Require().NoError(err) resp, err := client.Do(req) c.Require().NoError(err) @@ -102,16 +105,19 @@ func (c *RelayerServerSuite) TestGetQuoteRequestByTxID() { c.Equal(http.StatusOK, resp.StatusCode) // Compare to expected result - var result relapi.GetQuoteRequestStatusResponse + var result relapi.GetQuoteRequestResponse err = json.NewDecoder(resp.Body).Decode(&result) c.Require().NoError(err) - expectedResult := relapi.GetQuoteRequestStatusResponse{ - Status: quoteRequest.Status.String(), - TxID: hexutil.Encode(quoteRequest.TransactionID[:]), - OriginTxHash: quoteRequest.OriginTxHash.String(), - OriginChainID: quoteRequest.Transaction.OriginChainId, - DestChainID: quoteRequest.Transaction.DestChainId, - DestTxHash: quoteRequest.DestTxHash.String(), + expectedResult := relapi.GetQuoteRequestResponse{ + Status: quoteRequest.Status.String(), + TxID: hexutil.Encode(quoteRequest.TransactionID[:]), + QuoteRequestRaw: result.QuoteRequestRaw, + OriginTxHash: quoteRequest.OriginTxHash.String(), + DestTxHash: quoteRequest.DestTxHash.String(), + OriginChainID: quoteRequest.Transaction.OriginChainId, + DestChainID: quoteRequest.Transaction.DestChainId, + OriginToken: quoteRequest.Transaction.OriginToken.String(), + DestToken: quoteRequest.Transaction.DestToken.String(), } c.Equal(expectedResult, result) c.GetTestContext().Done() diff --git a/services/rfq/relayer/reldb/db_test.go b/services/rfq/relayer/reldb/db_test.go index 4bcf426ee8..c118560883 100644 --- a/services/rfq/relayer/reldb/db_test.go +++ b/services/rfq/relayer/reldb/db_test.go @@ -11,25 +11,43 @@ import ( func (d *DBSuite) TestBlock() { d.RunOnAllDBs(func(testDB reldb.Service) { - const testChainID = 5 - _, err := testDB.LatestBlockForChain(d.GetTestContext(), testChainID) + const chainIDA = 5 + const chainIDB = 6 + _, err := testDB.LatestBlockForChain(d.GetTestContext(), chainIDA) d.True(errors.Is(err, listener.ErrNoLatestBlockForChainID)) + _, err = testDB.LatestBlockForChain(d.GetTestContext(), chainIDB) + d.True(errors.Is(err, listener.ErrNoLatestBlockForChainID)) + + testHeightA := 10 + testHeightB := 100 + + err = testDB.PutLatestBlock(d.GetTestContext(), chainIDA, uint64(testHeightA)) + d.NoError(err) - testHeight := 10 + err = testDB.PutLatestBlock(d.GetTestContext(), chainIDB, uint64(testHeightB)) + d.NoError(err) + + lastHeight, err := testDB.LatestBlockForChain(d.GetTestContext(), chainIDA) + d.NoError(err) + d.Equal(lastHeight, uint64(testHeightA)) - err = testDB.PutLatestBlock(d.GetTestContext(), testChainID, uint64(testHeight)) + lastHeight, err = testDB.LatestBlockForChain(d.GetTestContext(), chainIDB) d.NoError(err) + d.Equal(lastHeight, uint64(testHeightB)) - lastHeight, err := testDB.LatestBlockForChain(d.GetTestContext(), testChainID) + testHeightA++ + err = testDB.PutLatestBlock(d.GetTestContext(), chainIDA, uint64(testHeightA)) + d.NoError(err) + lastHeight, err = testDB.LatestBlockForChain(d.GetTestContext(), chainIDA) d.NoError(err) - d.Equal(lastHeight, uint64(testHeight)) + d.Equal(lastHeight, uint64(testHeightA)) - testHeight++ - err = testDB.PutLatestBlock(d.GetTestContext(), testChainID, uint64(testHeight)) + testHeightB++ + err = testDB.PutLatestBlock(d.GetTestContext(), chainIDB, uint64(testHeightB)) d.NoError(err) - lastHeight, err = testDB.LatestBlockForChain(d.GetTestContext(), testChainID) + lastHeight, err = testDB.LatestBlockForChain(d.GetTestContext(), chainIDB) d.NoError(err) - d.Equal(lastHeight, uint64(testHeight)) + d.Equal(lastHeight, uint64(testHeightB)) }) } diff --git a/services/rfq/relayer/service/handlers.go b/services/rfq/relayer/service/handlers.go index 46b00e9ecc..843b7a8fb8 100644 --- a/services/rfq/relayer/service/handlers.go +++ b/services/rfq/relayer/service/handlers.go @@ -162,6 +162,46 @@ func (q *QuoteRequestHandler) handleSeen(ctx context.Context, span trace.Span, r return nil } + // check balance and mark it as CommitPending or NotEnoughInventory. + // note that this will update the request.Status in-place. + err = q.commitPendingBalance(ctx, span, &request) + if err != nil { + return fmt.Errorf("could not commit pending balance: %w", err) + } + + //nolint:exhaustive + switch request.Status { + case reldb.CommittedPending: + // immediately forward the request to handleCommitPending + span.AddEvent("forwarding to handleCommitPending") + fwdErr := q.Forward(ctx, request) + if fwdErr != nil { + logger.Errorf("could not forward to handle commit pending: %w", fwdErr) + span.AddEvent(fmt.Sprintf("could not forward to handle commit pending: %s", fwdErr.Error())) + } + case reldb.NotEnoughInventory: + span.AddEvent("not enough inventory; not forwarding") + default: + logger.Errorf("unexpected request status: %s", request.Status.String()) + span.AddEvent(fmt.Sprintf("unexpected request status: %s", request.Status.String())) + } + + return nil +} + +// commitPendingBalance locks the balance and marks the request as CommitPending. +func (q *QuoteRequestHandler) commitPendingBalance(ctx context.Context, span trace.Span, request *reldb.QuoteRequest) (err error) { + // lock the consumed balance + key := getBalanceMtxKey(q.Dest.ChainID, request.Transaction.DestToken) + span.SetAttributes(attribute.String("balance_lock_key", key)) + unlocker, ok := q.balanceMtx.TryLock(key) + if !ok { + // balance is locked due to concurrent request, try again later + span.SetAttributes(attribute.Bool("locked", true)) + return nil + } + defer unlocker.Unlock() + // get destination committable balance committableBalance, err := q.Inventory.GetCommittableBalance(ctx, int(q.Dest.ChainID), request.Transaction.DestToken) if errors.Is(err, inventory.ErrUnsupportedChain) { @@ -179,6 +219,7 @@ func (q *QuoteRequestHandler) handleSeen(ctx context.Context, span trace.Span, r // check if we have enough inventory to handle the request if committableBalance.Cmp(request.Transaction.DestAmount) < 0 { + request.Status = reldb.NotEnoughInventory err = q.db.UpdateQuoteRequestStatus(ctx, request.TransactionID, reldb.NotEnoughInventory, &request.Status) if err != nil { return fmt.Errorf("could not update request status: %w", err) @@ -211,14 +252,6 @@ func (q *QuoteRequestHandler) handleSeen(ctx context.Context, span trace.Span, r return fmt.Errorf("could not update request status: %w", err) } - // immediately forward the request to handleCommitPending - span.AddEvent("forwarding to handleCommitPending") - fwdErr := q.Forward(ctx, request) - if fwdErr != nil { - logger.Errorf("could not forward to handle commit pending: %w", fwdErr) - span.AddEvent("could not forward to handle commit pending") - } - return nil } @@ -487,12 +520,23 @@ func (q *QuoteRequestHandler) handleProofPosted(ctx context.Context, span trace. // Error Handlers Only from this point below. // // handleNotEnoughInventory handles the not enough inventory status. -func (q *QuoteRequestHandler) handleNotEnoughInventory(ctx context.Context, _ trace.Span, request reldb.QuoteRequest) (err error) { +func (q *QuoteRequestHandler) handleNotEnoughInventory(ctx context.Context, span trace.Span, request reldb.QuoteRequest) (err error) { + // acquire balance lock + key := getBalanceMtxKey(q.Dest.ChainID, request.Transaction.DestToken) + span.SetAttributes(attribute.String("balance_lock_key", key)) + unlocker, ok := q.balanceMtx.TryLock(key) + if !ok { + // balance is locked due to concurrent request, try again later + span.SetAttributes(attribute.Bool("locked", true)) + return nil + } + defer unlocker.Unlock() + + // commit destination balance committableBalance, err := q.Inventory.GetCommittableBalance(ctx, int(q.Dest.ChainID), request.Transaction.DestToken) if err != nil { return fmt.Errorf("could not get committable balance: %w", err) } - // if committableBalance > destAmount if committableBalance.Cmp(request.Transaction.DestAmount) > 0 { err = q.db.UpdateQuoteRequestStatus(ctx, request.TransactionID, reldb.CommittedPending, &request.Status) if err != nil { diff --git a/services/rfq/relayer/service/relayer.go b/services/rfq/relayer/service/relayer.go index 068f0bb5ad..bf3d7a3b2b 100644 --- a/services/rfq/relayer/service/relayer.go +++ b/services/rfq/relayer/service/relayer.go @@ -61,8 +61,10 @@ type Relayer struct { decimalsCache *xsync.MapOf[string, *uint8] // semaphore is used to limit the number of concurrent requests semaphore *semaphore.Weighted - // handlerMtx is used to synchronize handling of relay requests - handlerMtx mapmutex.StringMapMutex + // handlerMtx is used to synchronize handling of relay requests, keyed on transaction ID + handlerMtx mapmutex.StringMapMutex + // balanceMtx is used to synchronize balance requests, keyed on a chainID and tokenAddress pair + balanceMtx mapmutex.StringMapMutex otelRecorder iOtelRecorder } @@ -105,7 +107,7 @@ func NewRelayer(ctx context.Context, metricHandler metrics.Handler, cfg relconfi if err != nil { return nil, fmt.Errorf("could not get deploy block: %w", err) } - chainListener, err := listener.NewChainListener(chainClient, store, rfqAddr, uint64(startBlock.Int64()), metricHandler) + chainListener, err := listener.NewChainListener(chainClient, store, rfqAddr, uint64(startBlock.Int64()), metricHandler, listener.WithName("relayer")) if err != nil { return nil, fmt.Errorf("could not get chain listener: %w", err) } @@ -165,6 +167,7 @@ func NewRelayer(ctx context.Context, metricHandler metrics.Handler, cfg relconfi apiClient: apiClient, semaphore: semaphore.NewWeighted(maxConcurrentRequests), handlerMtx: mapmutex.NewStringMapMutex(), + balanceMtx: mapmutex.NewStringMapMutex(), otelRecorder: otelRecorder, } return &rel, nil diff --git a/services/rfq/relayer/service/statushandler.go b/services/rfq/relayer/service/statushandler.go index 6aedc1c331..8e6663fd2e 100644 --- a/services/rfq/relayer/service/statushandler.go +++ b/services/rfq/relayer/service/statushandler.go @@ -52,6 +52,12 @@ type QuoteRequestHandler struct { mutexMiddlewareFunc func(func(ctx context.Context, span trace.Span, req reldb.QuoteRequest) error) func(ctx context.Context, span trace.Span, req reldb.QuoteRequest) error // handlerMtx is the mutex for relaying. handlerMtx mapmutex.StringMapMutex + // balanceMtx is the mutex for balances. + balanceMtx mapmutex.StringMapMutex +} + +func getBalanceMtxKey(chainID uint32, token common.Address) string { + return fmt.Sprintf("%d-%s", chainID, token.Hex()) } // Handler is the handler for a quote request. @@ -81,6 +87,7 @@ func (r *Relayer) requestToHandler(ctx context.Context, req reldb.QuoteRequest) apiClient: r.apiClient, mutexMiddlewareFunc: r.mutexMiddleware, handlerMtx: r.handlerMtx, + balanceMtx: r.balanceMtx, } // wrap in deadline middleware since the relay has not yet happened diff --git a/services/scribe/go.mod b/services/scribe/go.mod index 2f2f29c5b9..52377cd471 100644 --- a/services/scribe/go.mod +++ b/services/scribe/go.mod @@ -57,9 +57,9 @@ require ( go.opentelemetry.io/otel/metric v1.28.0 go.opentelemetry.io/otel/trace v1.28.0 go.uber.org/atomic v1.11.0 - golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 + golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 golang.org/x/oauth2 v0.21.0 - golang.org/x/sync v0.7.0 + golang.org/x/sync v0.8.0 google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 google.golang.org/grpc v1.64.0 google.golang.org/protobuf v1.34.2 @@ -209,7 +209,7 @@ require ( github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.15 // indirect + github.com/mattn/go-runewidth v0.0.16 // indirect github.com/mattn/go-sqlite3 v2.0.3+incompatible // indirect github.com/mattn/go-tty v0.0.3 // indirect github.com/miguelmota/go-ethereum-hdwallet v0.1.1 // indirect @@ -295,15 +295,15 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/arch v0.8.0 // indirect - golang.org/x/crypto v0.24.0 // indirect + golang.org/x/crypto v0.26.0 // indirect golang.org/x/image v0.6.0 // indirect - golang.org/x/mod v0.19.0 // indirect - golang.org/x/net v0.26.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/term v0.21.0 // indirect - golang.org/x/text v0.16.0 // indirect + golang.org/x/mod v0.20.0 // indirect + golang.org/x/net v0.28.0 // indirect + golang.org/x/sys v0.24.0 // indirect + golang.org/x/term v0.23.0 // indirect + golang.org/x/text v0.17.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.22.0 // indirect + golang.org/x/tools v0.24.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect gopkg.in/hedzr/errors.v3 v3.1.1 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect diff --git a/services/scribe/go.sum b/services/scribe/go.sum index bbc31fcc27..542ff2110e 100644 --- a/services/scribe/go.sum +++ b/services/scribe/go.sum @@ -841,8 +841,8 @@ github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzp github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= -github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= -github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= +github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U= github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= @@ -1288,8 +1288,8 @@ golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2Uz golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1303,8 +1303,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 h1:yixxcjnhBmY0nkL253HFVIm0JsFHwrHdT3Yh6szTnfY= -golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8/go.mod h1:jj3sYF3dwk5D+ghuXyeI3r5MFf+NT2An6/9dOA95KSI= +golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 h1:kx6Ds3MlpiUHKj7syVnbp57++8WpuKPcR5yjLBjvLEA= +golang.org/x/exp v0.0.0-20240823005443-9b4947da3948/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -1337,8 +1337,8 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= -golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= +golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1396,8 +1396,8 @@ golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1422,8 +1422,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1518,8 +1518,8 @@ golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1529,8 +1529,8 @@ golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= +golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1546,8 +1546,8 @@ golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1618,8 +1618,8 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= -golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/tools/go.mod b/tools/go.mod index d0b4475e67..799920b7aa 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -18,8 +18,8 @@ require ( github.com/synapsecns/sanguine/core v0.0.0-00010101000000-000000000000 github.com/thoas/go-funk v0.9.0 github.com/urfave/cli/v2 v2.27.2 - golang.org/x/mod v0.19.0 - golang.org/x/tools v0.22.0 + golang.org/x/mod v0.20.0 + golang.org/x/tools v0.24.0 ) require ( @@ -68,7 +68,7 @@ require ( github.com/kevinburke/ssh_config v1.2.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.15 // indirect + github.com/mattn/go-runewidth v0.0.16 // indirect github.com/mattn/go-tty v0.0.3 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mmcloughlin/addchain v0.4.0 // indirect @@ -94,12 +94,12 @@ require ( github.com/yusufpapurcu/wmi v1.2.3 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/crypto v0.24.0 // indirect - golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect - golang.org/x/net v0.26.0 // indirect - golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/text v0.16.0 // indirect + golang.org/x/crypto v0.26.0 // indirect + golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 // indirect + golang.org/x/net v0.28.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.24.0 // indirect + golang.org/x/text v0.17.0 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/apimachinery v0.29.3 // indirect diff --git a/tools/go.sum b/tools/go.sum index 4901d2095e..08a6a2d339 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -369,8 +369,8 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= -github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= +github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-tty v0.0.3 h1:5OfyWorkyO7xP52Mq7tB36ajHDG5OHrmBGIS/DtakQI= github.com/mattn/go-tty v0.0.3/go.mod h1:ihxohKRERHTVzN+aSVRwACLCeqIoZAWpoICkkvrWyR0= github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= @@ -555,8 +555,8 @@ golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -567,8 +567,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 h1:yixxcjnhBmY0nkL253HFVIm0JsFHwrHdT3Yh6szTnfY= -golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8/go.mod h1:jj3sYF3dwk5D+ghuXyeI3r5MFf+NT2An6/9dOA95KSI= +golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 h1:kx6Ds3MlpiUHKj7syVnbp57++8WpuKPcR5yjLBjvLEA= +golang.org/x/exp v0.0.0-20240823005443-9b4947da3948/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -596,8 +596,8 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= -golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= +golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -640,8 +640,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -664,8 +664,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -732,15 +732,15 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= +golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -753,8 +753,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -817,8 +817,8 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= -golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/yarn.lock b/yarn.lock index 79bf6ddc62..982bae061d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -255,6 +255,14 @@ "@babel/highlight" "^7.24.2" picocolors "^1.0.0" +"@babel/code-frame@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.24.7.tgz#882fd9e09e8ee324e496bd040401c6f046ef4465" + integrity sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA== + dependencies: + "@babel/highlight" "^7.24.7" + picocolors "^1.0.0" + "@babel/compat-data@^7.20.5", "@babel/compat-data@^7.22.6", "@babel/compat-data@^7.23.5", "@babel/compat-data@^7.24.1": version "7.24.1" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.24.1.tgz#31c1f66435f2a9c329bb5716a6d6186c516c3742" @@ -265,6 +273,11 @@ resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.24.4.tgz#6f102372e9094f25d908ca0d34fc74c74606059a" integrity sha512-vg8Gih2MLK+kOkHJp4gBEIkyaIi00jgWot2D9QOmmfLC8jINSOzmCLta6Bvz/JSBCqnegV0L80jhxkol5GWNfQ== +"@babel/compat-data@^7.24.8": + version "7.24.9" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.24.9.tgz#53eee4e68f1c1d0282aa0eb05ddb02d033fc43a0" + integrity sha512-e701mcfApCJqMMueQI0Fb68Amflj83+dvAvHawoBpAz+GDjCIyGHzNwnefjsWJ3xiYAqqiQFoWbspGYBdb2/ng== + "@babel/core@7.12.9": version "7.12.9" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.12.9.tgz#fd450c4ec10cdbb980e2928b7aa7a28484593fc8" @@ -329,6 +342,27 @@ json5 "^2.2.3" semver "^6.3.1" +"@babel/core@^7.23.9": + version "7.24.9" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.24.9.tgz#dc07c9d307162c97fa9484ea997ade65841c7c82" + integrity sha512-5e3FI4Q3M3Pbr21+5xJwCv6ZT6KmGkI0vw3Tozy5ODAQFTIWe37iT8Cr7Ice2Ntb+M3iSKCEWMB1MBgKrW3whg== + dependencies: + "@ampproject/remapping" "^2.2.0" + "@babel/code-frame" "^7.24.7" + "@babel/generator" "^7.24.9" + "@babel/helper-compilation-targets" "^7.24.8" + "@babel/helper-module-transforms" "^7.24.9" + "@babel/helpers" "^7.24.8" + "@babel/parser" "^7.24.8" + "@babel/template" "^7.24.7" + "@babel/traverse" "^7.24.8" + "@babel/types" "^7.24.9" + convert-source-map "^2.0.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.2.3" + semver "^6.3.1" + "@babel/eslint-parser@^7.18.2": version "7.24.1" resolved "https://registry.yarnpkg.com/@babel/eslint-parser/-/eslint-parser-7.24.1.tgz#e27eee93ed1d271637165ef3a86e2b9332395c32" @@ -378,6 +412,16 @@ "@jridgewell/trace-mapping" "^0.3.25" jsesc "^2.5.1" +"@babel/generator@^7.24.8", "@babel/generator@^7.24.9", "@babel/generator@^7.7.2": + version "7.24.10" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.24.10.tgz#a4ab681ec2a78bbb9ba22a3941195e28a81d8e76" + integrity sha512-o9HBZL1G2129luEUlG1hB4N/nlYNWHnpwlND9eOMclRqqu1YDy2sSYVCFUZwl8I1Gxh+QSRrP2vD7EpUmFVXxg== + dependencies: + "@babel/types" "^7.24.9" + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.25" + jsesc "^2.5.1" + "@babel/helper-annotate-as-pure@^7.18.6", "@babel/helper-annotate-as-pure@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz#e7f06737b197d580a01edf75d97e2c8be99d3882" @@ -403,6 +447,17 @@ lru-cache "^5.1.1" semver "^6.3.1" +"@babel/helper-compilation-targets@^7.24.8": + version "7.24.8" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.24.8.tgz#b607c3161cd9d1744977d4f97139572fe778c271" + integrity sha512-oU+UoqCHdp+nWVDkpldqIQL/i/bvAv53tRqLG/s+cOXxe66zOYLU7ar/Xs3LdmBihrUMEUhwu6dMZwbNOYDwvw== + dependencies: + "@babel/compat-data" "^7.24.8" + "@babel/helper-validator-option" "^7.24.8" + browserslist "^4.23.1" + lru-cache "^5.1.1" + semver "^6.3.1" + "@babel/helper-create-class-features-plugin@^7.18.6", "@babel/helper-create-class-features-plugin@^7.21.0", "@babel/helper-create-class-features-plugin@^7.24.1": version "7.24.1" resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.24.1.tgz#db58bf57137b623b916e24874ab7188d93d7f68f" @@ -486,6 +541,13 @@ resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz#96159db61d34a29dba454c959f5ae4a649ba9167" integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA== +"@babel/helper-environment-visitor@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.24.7.tgz#4b31ba9551d1f90781ba83491dd59cf9b269f7d9" + integrity sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ== + dependencies: + "@babel/types" "^7.24.7" + "@babel/helper-function-name@^7.22.5", "@babel/helper-function-name@^7.23.0": version "7.23.0" resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz#1f9a3cdbd5b2698a670c30d2735f9af95ed52759" @@ -494,6 +556,14 @@ "@babel/template" "^7.22.15" "@babel/types" "^7.23.0" +"@babel/helper-function-name@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.24.7.tgz#75f1e1725742f39ac6584ee0b16d94513da38dd2" + integrity sha512-FyoJTsj/PEUWu1/TYRiXTIHc8lbw+TDYkZuoE43opPS5TrI7MyONBE1oNvfguEXAD9yhQRrVBnXdXzSLQl9XnA== + dependencies: + "@babel/template" "^7.24.7" + "@babel/types" "^7.24.7" + "@babel/helper-hoist-variables@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz#c01a007dac05c085914e8fb652b339db50d823bb" @@ -501,6 +571,13 @@ dependencies: "@babel/types" "^7.22.5" +"@babel/helper-hoist-variables@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.24.7.tgz#b4ede1cde2fd89436397f30dc9376ee06b0f25ee" + integrity sha512-MJJwhkoGy5c4ehfoRyrJ/owKeMl19U54h27YYftT0o2teQ3FJ3nQUf/I3LlJsX4l3qlw7WRXUmiyajvHXoTubQ== + dependencies: + "@babel/types" "^7.24.7" + "@babel/helper-member-expression-to-functions@^7.23.0": version "7.23.0" resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.23.0.tgz#9263e88cc5e41d39ec18c9a3e0eced59a3e7d366" @@ -522,6 +599,14 @@ dependencies: "@babel/types" "^7.24.0" +"@babel/helper-module-imports@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.24.7.tgz#f2f980392de5b84c3328fc71d38bd81bbb83042b" + integrity sha512-8AyH3C+74cgCVVXow/myrynrAGv+nTVg5vKu2nZph9x7RcRwzmh0VFallJuFTZ9mx6u4eSdXZfcOzSqTUm0HCA== + dependencies: + "@babel/traverse" "^7.24.7" + "@babel/types" "^7.24.7" + "@babel/helper-module-transforms@^7.12.1", "@babel/helper-module-transforms@^7.23.3": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz#d7d12c3c5d30af5b3c0fcab2a6d5217773e2d0f1" @@ -544,6 +629,17 @@ "@babel/helper-split-export-declaration" "^7.24.5" "@babel/helper-validator-identifier" "^7.24.5" +"@babel/helper-module-transforms@^7.24.8", "@babel/helper-module-transforms@^7.24.9": + version "7.24.9" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.24.9.tgz#e13d26306b89eea569180868e652e7f514de9d29" + integrity sha512-oYbh+rtFKj/HwBQkFlUzvcybzklmVdVV3UU+mN7n2t/q3yGHbuVdNxyFvSBO1tfvjyArpHNcWMAzsSPdyI46hw== + dependencies: + "@babel/helper-environment-visitor" "^7.24.7" + "@babel/helper-module-imports" "^7.24.7" + "@babel/helper-simple-access" "^7.24.7" + "@babel/helper-split-export-declaration" "^7.24.7" + "@babel/helper-validator-identifier" "^7.24.7" + "@babel/helper-optimise-call-expression@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz#f21531a9ccbff644fdd156b4077c16ff0c3f609e" @@ -566,6 +662,11 @@ resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.5.tgz#a924607dd254a65695e5bd209b98b902b3b2f11a" integrity sha512-xjNLDopRzW2o6ba0gKbkZq5YWEBaK3PCyTOY1K2P/O07LGMhMqlMXPxwN4S5/RhWuCobT8z0jrlKGlYmeR1OhQ== +"@babel/helper-plugin-utils@^7.24.7", "@babel/helper-plugin-utils@^7.24.8": + version "7.24.8" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.8.tgz#94ee67e8ec0e5d44ea7baeb51e571bd26af07878" + integrity sha512-FFWx5142D8h2Mgr/iPVGH5G7w6jDn4jUSpZTyDnQO0Yn7Ks2Kuz6Pci8H6MPCoUJegd/UZQ3tAvfLCxQSnWWwg== + "@babel/helper-remap-async-to-generator@^7.22.20": version "7.22.20" resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.22.20.tgz#7b68e1cb4fa964d2996fd063723fb48eca8498e0" @@ -598,6 +699,14 @@ dependencies: "@babel/types" "^7.24.5" +"@babel/helper-simple-access@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.24.7.tgz#bcade8da3aec8ed16b9c4953b74e506b51b5edb3" + integrity sha512-zBAIvbCMh5Ts+b86r/CjU+4XGYIs+R1j951gxI3KmmxBMhCg4oQMsv6ZXQ64XOm/cvzfU1FmoCyt6+owc5QMYg== + dependencies: + "@babel/traverse" "^7.24.7" + "@babel/types" "^7.24.7" + "@babel/helper-skip-transparent-expression-wrappers@^7.20.0", "@babel/helper-skip-transparent-expression-wrappers@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz#007f15240b5751c537c40e77abb4e89eeaaa8847" @@ -619,11 +728,23 @@ dependencies: "@babel/types" "^7.24.5" +"@babel/helper-split-export-declaration@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.24.7.tgz#83949436890e07fa3d6873c61a96e3bbf692d856" + integrity sha512-oy5V7pD+UvfkEATUKvIjvIAH/xCzfsFVw7ygW2SI6NClZzquT+mwdTfgfdbUiceh6iQO0CHtCPsyze/MZ2YbAA== + dependencies: + "@babel/types" "^7.24.7" + "@babel/helper-string-parser@^7.23.4", "@babel/helper-string-parser@^7.24.1": version "7.24.1" resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.24.1.tgz#f99c36d3593db9540705d0739a1f10b5e20c696e" integrity sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ== +"@babel/helper-string-parser@^7.24.8": + version "7.24.8" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz#5b3329c9a58803d5df425e5785865881a81ca48d" + integrity sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ== + "@babel/helper-validator-identifier@^7.15.7", "@babel/helper-validator-identifier@^7.22.20": version "7.22.20" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" @@ -634,11 +755,21 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.5.tgz#918b1a7fa23056603506370089bd990d8720db62" integrity sha512-3q93SSKX2TWCG30M2G2kwaKeTYgEUp5Snjuj8qm729SObL6nbtUldAi37qbxkD5gg3xnBio+f9nqpSepGZMvxA== +"@babel/helper-validator-identifier@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz#75b889cfaf9e35c2aaf42cf0d72c8e91719251db" + integrity sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w== + "@babel/helper-validator-option@^7.23.5": version "7.23.5" resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz#907a3fbd4523426285365d1206c423c4c5520307" integrity sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw== +"@babel/helper-validator-option@^7.24.8": + version "7.24.8" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.24.8.tgz#3725cdeea8b480e86d34df15304806a06975e33d" + integrity sha512-xb8t9tD1MHLungh/AIoWYN+gVHaB9kwlu8gffXGSt3FFEIT7RjS+xWbc2vUD1UTZdIpKj/ab3rdqJ7ufngyi2Q== + "@babel/helper-wrap-function@^7.22.20": version "7.22.20" resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.22.20.tgz#15352b0b9bfb10fc9c76f79f6342c00e3411a569" @@ -666,6 +797,14 @@ "@babel/traverse" "^7.24.5" "@babel/types" "^7.24.5" +"@babel/helpers@^7.24.8": + version "7.24.8" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.24.8.tgz#2820d64d5d6686cca8789dd15b074cd862795873" + integrity sha512-gV2265Nkcz7weJJfvDoAEVzC1e2OTDpkGbEsebse8koXUJUXPsCMi7sRo/+SPMuMZ9MtUPnGwITTnQnU5YjyaQ== + dependencies: + "@babel/template" "^7.24.7" + "@babel/types" "^7.24.8" + "@babel/highlight@^7.24.2": version "7.24.2" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.24.2.tgz#3f539503efc83d3c59080a10e6634306e0370d26" @@ -676,6 +815,16 @@ js-tokens "^4.0.0" picocolors "^1.0.0" +"@babel/highlight@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.24.7.tgz#a05ab1df134b286558aae0ed41e6c5f731bf409d" + integrity sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw== + dependencies: + "@babel/helper-validator-identifier" "^7.24.7" + chalk "^2.4.2" + js-tokens "^4.0.0" + picocolors "^1.0.0" + "@babel/parser@^7.1.0", "@babel/parser@^7.11.5", "@babel/parser@^7.12.11", "@babel/parser@^7.12.7", "@babel/parser@^7.14.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.8", "@babel/parser@^7.20.7", "@babel/parser@^7.23.0", "@babel/parser@^7.23.9", "@babel/parser@^7.24.0", "@babel/parser@^7.24.1", "@babel/parser@^7.7.0": version "7.24.1" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.24.1.tgz#1e416d3627393fab1cb5b0f2f1796a100ae9133a" @@ -686,6 +835,11 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.24.5.tgz#4a4d5ab4315579e5398a82dcf636ca80c3392790" integrity sha512-EOv5IK8arwh3LI47dz1b0tKUb/1uhHAnHJOrjgtQMIpu1uXd9mlFrJg9IUgGUgZ41Ch0K8REPTYpO7B76b4vJg== +"@babel/parser@^7.24.7", "@babel/parser@^7.24.8": + version "7.24.8" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.24.8.tgz#58a4dbbcad7eb1d48930524a3fd93d93e9084c6f" + integrity sha512-WzfbgXOkGzZiXXCqk43kKwZjzwx4oulxZi3nq2TYL9mOjQv6kYwul9mz6ID36njuL7Xkp6nJEfok848Zj10j/w== + "@babel/plugin-bugfix-firefox-class-in-computed-class-key@^7.24.5": version "7.24.5" resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.24.5.tgz#4c3685eb9cd790bcad2843900fe0250c91ccf895" @@ -915,6 +1069,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.24.0" +"@babel/plugin-syntax-jsx@^7.7.2": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.24.7.tgz#39a1fa4a7e3d3d7f34e2acc6be585b718d30e02d" + integrity sha512-6ddciUPe/mpMnOKv/U+RSd2vvVy+Yw/JfBB0ZHYjEZt9NLHmCUylNYlsbqCCS1Bffjlb0fCwC9Vqz+sBz6PsiQ== + dependencies: + "@babel/helper-plugin-utils" "^7.24.7" + "@babel/plugin-syntax-logical-assignment-operators@^7.10.4", "@babel/plugin-syntax-logical-assignment-operators@^7.8.3": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" @@ -978,6 +1139,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.24.0" +"@babel/plugin-syntax-typescript@^7.7.2": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.24.7.tgz#58d458271b4d3b6bb27ee6ac9525acbb259bad1c" + integrity sha512-c/+fVeJBB0FeKsFvwytYiUD+LBvhHjGSI0g446PRGdSVGZLRNArBUno2PETbAly3tpiNAQR5XaZ+JslxkotsbA== + dependencies: + "@babel/helper-plugin-utils" "^7.24.7" + "@babel/plugin-syntax-unicode-sets-regex@^7.18.6": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz#d49a3b3e6b52e5be6740022317580234a6a47357" @@ -1220,6 +1388,15 @@ "@babel/helper-plugin-utils" "^7.24.0" "@babel/helper-simple-access" "^7.22.5" +"@babel/plugin-transform-modules-commonjs@^7.24.8": + version "7.24.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.24.8.tgz#ab6421e564b717cb475d6fff70ae7f103536ea3c" + integrity sha512-WHsk9H8XxRs3JXKWFiqtQebdh9b/pTk4EgueygFzYlTKAg0Ud985mSevdNjdXdFBATSKVJGQXP1tv6aGbssLKA== + dependencies: + "@babel/helper-module-transforms" "^7.24.8" + "@babel/helper-plugin-utils" "^7.24.8" + "@babel/helper-simple-access" "^7.24.7" + "@babel/plugin-transform-modules-systemjs@^7.24.1": version "7.24.1" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.24.1.tgz#2b9625a3d4e445babac9788daec39094e6b11e3e" @@ -1812,6 +1989,15 @@ "@babel/parser" "^7.24.0" "@babel/types" "^7.24.0" +"@babel/template@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.24.7.tgz#02efcee317d0609d2c07117cb70ef8fb17ab7315" + integrity sha512-jYqfPrU9JTF0PmPy1tLYHW4Mp4KlgxJD9l2nP9fD6yT/ICi554DmrWBAEYpIelzjHf1msDP3PxJIRt/nFNfBig== + dependencies: + "@babel/code-frame" "^7.24.7" + "@babel/parser" "^7.24.7" + "@babel/types" "^7.24.7" + "@babel/traverse@^7.1.0", "@babel/traverse@^7.1.6", "@babel/traverse@^7.11.5", "@babel/traverse@^7.12.11", "@babel/traverse@^7.12.9", "@babel/traverse@^7.13.0", "@babel/traverse@^7.14.0", "@babel/traverse@^7.16.8", "@babel/traverse@^7.23.2", "@babel/traverse@^7.24.1", "@babel/traverse@^7.7.0": version "7.24.1" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.24.1.tgz#d65c36ac9dd17282175d1e4a3c49d5b7988f530c" @@ -1844,6 +2030,22 @@ debug "^4.3.1" globals "^11.1.0" +"@babel/traverse@^7.24.7", "@babel/traverse@^7.24.8": + version "7.24.8" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.24.8.tgz#6c14ed5232b7549df3371d820fbd9abfcd7dfab7" + integrity sha512-t0P1xxAPzEDcEPmjprAQq19NWum4K0EQPjMwZQZbHt+GiZqvjCHjj755Weq1YRPVzBI+3zSfvScfpnuIecVFJQ== + dependencies: + "@babel/code-frame" "^7.24.7" + "@babel/generator" "^7.24.8" + "@babel/helper-environment-visitor" "^7.24.7" + "@babel/helper-function-name" "^7.24.7" + "@babel/helper-hoist-variables" "^7.24.7" + "@babel/helper-split-export-declaration" "^7.24.7" + "@babel/parser" "^7.24.8" + "@babel/types" "^7.24.8" + debug "^4.3.1" + globals "^11.1.0" + "@babel/types@^7.0.0", "@babel/types@^7.12.11", "@babel/types@^7.12.7", "@babel/types@^7.16.8", "@babel/types@^7.18.13", "@babel/types@^7.2.0", "@babel/types@^7.20.7", "@babel/types@^7.22.10", "@babel/types@^7.22.15", "@babel/types@^7.22.19", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.23.4", "@babel/types@^7.24.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4", "@babel/types@^7.7.0": version "7.24.0" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.24.0.tgz#3b951f435a92e7333eba05b7566fd297960ea1bf" @@ -1862,6 +2064,15 @@ "@babel/helper-validator-identifier" "^7.24.5" to-fast-properties "^2.0.0" +"@babel/types@^7.24.7", "@babel/types@^7.24.8", "@babel/types@^7.24.9": + version "7.24.9" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.24.9.tgz#228ce953d7b0d16646e755acf204f4cf3d08cc73" + integrity sha512-xm8XrMKz0IlUdocVbYJe0Z9xEgidU7msskG8BbhnTPK/HZ2z/7FP7ykqPgrUH+C+r414mNfNWam1f2vqOjqjYQ== + dependencies: + "@babel/helper-string-parser" "^7.24.8" + "@babel/helper-validator-identifier" "^7.24.7" + to-fast-properties "^2.0.0" + "@base2/pretty-print-object@1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@base2/pretty-print-object/-/pretty-print-object-1.0.1.tgz#371ba8be66d556812dc7fb169ebc3c08378f69d4" @@ -3684,24 +3895,25 @@ resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6" integrity sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw== -"@graphql-codegen/add@^5.0.0": - version "5.0.2" - resolved "https://registry.yarnpkg.com/@graphql-codegen/add/-/add-5.0.2.tgz#71b3ae0465a4537172dddb84531b6967ca5545f2" - integrity sha512-ouBkSvMFUhda5VoKumo/ZvsZM9P5ZTyDsI8LW18VxSNWOjrTeLXBWHG8Gfaai0HwhflPtCYVABbriEcOmrRShQ== +"@graphql-codegen/add@^5.0.3": + version "5.0.3" + resolved "https://registry.yarnpkg.com/@graphql-codegen/add/-/add-5.0.3.tgz#1ede6bac9a93661ed7fa5808b203d079e1b1d215" + integrity sha512-SxXPmramkth8XtBlAHu4H4jYcYXM/o3p01+psU+0NADQowA8jtYkK6MW5rV6T+CxkEaNZItfSmZRPgIuypcqnA== dependencies: "@graphql-codegen/plugin-helpers" "^5.0.3" tslib "~2.6.0" -"@graphql-codegen/cli@5.0.0": - version "5.0.0" - resolved "https://registry.yarnpkg.com/@graphql-codegen/cli/-/cli-5.0.0.tgz#761dcf08cfee88bbdd9cdf8097b2343445ec6f0a" - integrity sha512-A7J7+be/a6e+/ul2KI5sfJlpoqeqwX8EzktaKCeduyVKgOLA6W5t+NUGf6QumBDXU8PEOqXk3o3F+RAwCWOiqA== +"@graphql-codegen/cli@5.0.2": + version "5.0.2" + resolved "https://registry.yarnpkg.com/@graphql-codegen/cli/-/cli-5.0.2.tgz#07ff691c16da4c3dcc0e1995d3231530379ab317" + integrity sha512-MBIaFqDiLKuO4ojN6xxG9/xL9wmfD3ZjZ7RsPjwQnSHBCUXnEkdKvX+JVpx87Pq29Ycn8wTJUguXnTZ7Di0Mlw== dependencies: "@babel/generator" "^7.18.13" "@babel/template" "^7.18.10" "@babel/types" "^7.18.13" - "@graphql-codegen/core" "^4.0.0" - "@graphql-codegen/plugin-helpers" "^5.0.1" + "@graphql-codegen/client-preset" "^4.2.2" + "@graphql-codegen/core" "^4.0.2" + "@graphql-codegen/plugin-helpers" "^5.0.3" "@graphql-tools/apollo-engine-loader" "^8.0.0" "@graphql-tools/code-file-loader" "^8.0.0" "@graphql-tools/git-loader" "^8.0.0" @@ -3732,26 +3944,26 @@ yaml "^2.3.1" yargs "^17.0.0" -"@graphql-codegen/client-preset@4.1.0": - version "4.1.0" - resolved "https://registry.yarnpkg.com/@graphql-codegen/client-preset/-/client-preset-4.1.0.tgz#81becd32b78b207b0e966876900537ec172d8df1" - integrity sha512-/3Ymb/fjxIF1+HGmaI1YwSZbWsrZAWMSQjh3dU425eBjctjsVQ6gzGRr+l/gE5F1mtmCf+vlbTAT03heAc/QIw== +"@graphql-codegen/client-preset@4.3.3", "@graphql-codegen/client-preset@^4.2.2": + version "4.3.3" + resolved "https://registry.yarnpkg.com/@graphql-codegen/client-preset/-/client-preset-4.3.3.tgz#3bbe5df5c49a8c9763cfc919679b15eeefbf1526" + integrity sha512-IrDsSVe8bkKtxgVfKPHzjL9tYlv7KEpA59R4gZLqx/t2WIJncW1i0OMvoz9tgoZsFEs8OKKgXZbnwPZ/Qf1kEw== dependencies: "@babel/helper-plugin-utils" "^7.20.2" "@babel/template" "^7.20.7" - "@graphql-codegen/add" "^5.0.0" - "@graphql-codegen/gql-tag-operations" "4.0.1" - "@graphql-codegen/plugin-helpers" "^5.0.1" - "@graphql-codegen/typed-document-node" "^5.0.1" - "@graphql-codegen/typescript" "^4.0.1" - "@graphql-codegen/typescript-operations" "^4.0.1" - "@graphql-codegen/visitor-plugin-common" "^4.0.1" + "@graphql-codegen/add" "^5.0.3" + "@graphql-codegen/gql-tag-operations" "4.0.9" + "@graphql-codegen/plugin-helpers" "^5.0.4" + "@graphql-codegen/typed-document-node" "^5.0.9" + "@graphql-codegen/typescript" "^4.0.9" + "@graphql-codegen/typescript-operations" "^4.2.3" + "@graphql-codegen/visitor-plugin-common" "^5.3.1" "@graphql-tools/documents" "^1.0.0" "@graphql-tools/utils" "^10.0.0" "@graphql-typed-document-node/core" "3.2.0" - tslib "~2.5.0" + tslib "~2.6.0" -"@graphql-codegen/core@^4.0.0": +"@graphql-codegen/core@^4.0.2": version "4.0.2" resolved "https://registry.yarnpkg.com/@graphql-codegen/core/-/core-4.0.2.tgz#7e6ec266276f54bbf02f60599d9e518f4a59d85e" integrity sha512-IZbpkhwVqgizcjNiaVzNAzm/xbWT6YnGgeOLwVjm4KbJn3V2jchVtuzHH09G5/WkkLSk2wgbXNdwjM41JxO6Eg== @@ -3761,25 +3973,25 @@ "@graphql-tools/utils" "^10.0.0" tslib "~2.6.0" -"@graphql-codegen/gql-tag-operations@4.0.1": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@graphql-codegen/gql-tag-operations/-/gql-tag-operations-4.0.1.tgz#36c7d40a135b9889d7f225166be323c3d48cee87" - integrity sha512-qF6wIbBzW8BNT+wiVsBxrYOs2oYcsxQ7mRvCpfEI3HnNZMAST/uX76W8MqFEJvj4mw7NIDv7xYJAcAZIWM5LWw== +"@graphql-codegen/gql-tag-operations@4.0.9": + version "4.0.9" + resolved "https://registry.yarnpkg.com/@graphql-codegen/gql-tag-operations/-/gql-tag-operations-4.0.9.tgz#261ecbc2e95d525caa12cad2e00d7c26575532e4" + integrity sha512-lVgu1HClel896HqZAEjynatlU6eJrYOw+rh05DPgM150xvmb7Gz5TnRHA2vfwlDNIXDaToAIpz5RFfkjjnYM1Q== dependencies: - "@graphql-codegen/plugin-helpers" "^5.0.0" - "@graphql-codegen/visitor-plugin-common" "4.0.1" + "@graphql-codegen/plugin-helpers" "^5.0.4" + "@graphql-codegen/visitor-plugin-common" "5.3.1" "@graphql-tools/utils" "^10.0.0" auto-bind "~4.0.0" - tslib "~2.5.0" + tslib "~2.6.0" -"@graphql-codegen/introspection@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@graphql-codegen/introspection/-/introspection-4.0.0.tgz#1d851d8fb38efbeaf45128456e3010a16e6c9708" - integrity sha512-t9g3AkK99dfHblMWtG4ynUM9+A7JrWq5110zSpNV2wlSnv0+bRKagDW8gozwgXfR5i1IIG8QDjJZ6VgXQVqCZw== +"@graphql-codegen/introspection@4.0.3": + version "4.0.3" + resolved "https://registry.yarnpkg.com/@graphql-codegen/introspection/-/introspection-4.0.3.tgz#756e39fb4529ea15d32a122f0bce9b0a66425379" + integrity sha512-4cHRG15Zu4MXMF4wTQmywNf4+fkDYv5lTbzraVfliDnB8rJKcaurQpRBi11KVuQUe24YTq/Cfk4uwewfNikWoA== dependencies: - "@graphql-codegen/plugin-helpers" "^5.0.0" - "@graphql-codegen/visitor-plugin-common" "^4.0.0" - tslib "~2.5.0" + "@graphql-codegen/plugin-helpers" "^5.0.3" + "@graphql-codegen/visitor-plugin-common" "^5.0.0" + tslib "~2.6.0" "@graphql-codegen/plugin-helpers@^2.7.2": version "2.7.2" @@ -3805,7 +4017,7 @@ lodash "~4.17.0" tslib "~2.4.0" -"@graphql-codegen/plugin-helpers@^5.0.0", "@graphql-codegen/plugin-helpers@^5.0.1", "@graphql-codegen/plugin-helpers@^5.0.3": +"@graphql-codegen/plugin-helpers@^5.0.3": version "5.0.3" resolved "https://registry.yarnpkg.com/@graphql-codegen/plugin-helpers/-/plugin-helpers-5.0.3.tgz#7027b9d911d7cb594663590fcf5d63e9cf7ec2ff" integrity sha512-yZ1rpULIWKBZqCDlvGIJRSyj1B2utkEdGmXZTBT/GVayP4hyRYlkd36AJV/LfEsVD8dnsKL5rLz2VTYmRNlJ5Q== @@ -3817,6 +4029,18 @@ lodash "~4.17.0" tslib "~2.6.0" +"@graphql-codegen/plugin-helpers@^5.0.4": + version "5.0.4" + resolved "https://registry.yarnpkg.com/@graphql-codegen/plugin-helpers/-/plugin-helpers-5.0.4.tgz#5f4c987c3f308ef1c8809ee0c43af0369867e0f6" + integrity sha512-MOIuHFNWUnFnqVmiXtrI+4UziMTYrcquljaI5f/T/Bc7oO7sXcfkAvgkNWEEi9xWreYwvuer3VHCuPI/lAFWbw== + dependencies: + "@graphql-tools/utils" "^10.0.0" + change-case-all "1.0.15" + common-tags "1.8.2" + import-from "4.0.0" + lodash "~4.17.0" + tslib "~2.6.0" + "@graphql-codegen/schema-ast@^4.0.2": version "4.0.2" resolved "https://registry.yarnpkg.com/@graphql-codegen/schema-ast/-/schema-ast-4.0.2.tgz#aeaa104e4555cca73a058f0a9350b4b0e290b377" @@ -3826,25 +4050,25 @@ "@graphql-tools/utils" "^10.0.0" tslib "~2.6.0" -"@graphql-codegen/typed-document-node@^5.0.1": - version "5.0.6" - resolved "https://registry.yarnpkg.com/@graphql-codegen/typed-document-node/-/typed-document-node-5.0.6.tgz#54750f4a7c6e963defeb6c27a9ea280a2a8bc2a3" - integrity sha512-US0J95hOE2/W/h42w4oiY+DFKG7IetEN1mQMgXXeat1w6FAR5PlIz4JrRrEkiVfVetZ1g7K78SOwBD8/IJnDiA== +"@graphql-codegen/typed-document-node@^5.0.9": + version "5.0.9" + resolved "https://registry.yarnpkg.com/@graphql-codegen/typed-document-node/-/typed-document-node-5.0.9.tgz#0bb72e505d4cf217790b0e761ff9da01f32d81c4" + integrity sha512-Wx6fyA4vpfIbfNTMiWUECGnjqzKkJdEbZHxVMIegiCBPzBYPAJV4mZZcildLAfm2FtZcgW4YKtFoTbnbXqPB3w== dependencies: - "@graphql-codegen/plugin-helpers" "^5.0.3" - "@graphql-codegen/visitor-plugin-common" "5.1.0" + "@graphql-codegen/plugin-helpers" "^5.0.4" + "@graphql-codegen/visitor-plugin-common" "5.3.1" auto-bind "~4.0.0" change-case-all "1.0.15" tslib "~2.6.0" -"@graphql-codegen/typescript-operations@^4.0.1": - version "4.2.0" - resolved "https://registry.yarnpkg.com/@graphql-codegen/typescript-operations/-/typescript-operations-4.2.0.tgz#0c6bbaf41cb325809b7e9e2b9d85ab01f11d142f" - integrity sha512-lmuwYb03XC7LNRS8oo9M4/vlOrq/wOKmTLBHlltK2YJ1BO/4K/Q9Jdv/jDmJpNydHVR1fmeF4wAfsIp1f9JibA== +"@graphql-codegen/typescript-operations@^4.2.3": + version "4.2.3" + resolved "https://registry.yarnpkg.com/@graphql-codegen/typescript-operations/-/typescript-operations-4.2.3.tgz#794e279f54f88f2df56eee6d045d16766ec06008" + integrity sha512-6z7avSSOr03l5SyKbeDs7MzRyGwnQFSCqQm8Om5wIuoIgXVu2gXRmcJAY/I7SLdAy9xbF4Sho7XNqieFM2CAFQ== dependencies: - "@graphql-codegen/plugin-helpers" "^5.0.3" - "@graphql-codegen/typescript" "^4.0.6" - "@graphql-codegen/visitor-plugin-common" "5.1.0" + "@graphql-codegen/plugin-helpers" "^5.0.4" + "@graphql-codegen/typescript" "^4.0.9" + "@graphql-codegen/visitor-plugin-common" "5.3.1" auto-bind "~4.0.0" tslib "~2.6.0" @@ -3859,14 +4083,14 @@ change-case-all "1.0.15" tslib "~2.4.0" -"@graphql-codegen/typescript@^4.0.1", "@graphql-codegen/typescript@^4.0.6": - version "4.0.6" - resolved "https://registry.yarnpkg.com/@graphql-codegen/typescript/-/typescript-4.0.6.tgz#2c9b70dc1eafda912de5e31c119c757b1aa5fca1" - integrity sha512-IBG4N+Blv7KAL27bseruIoLTjORFCT3r+QYyMC3g11uY3/9TPpaUyjSdF70yBe5GIQ6dAgDU+ENUC1v7EPi0rw== +"@graphql-codegen/typescript@^4.0.9": + version "4.0.9" + resolved "https://registry.yarnpkg.com/@graphql-codegen/typescript/-/typescript-4.0.9.tgz#25b7999b665d86a6459f90dd22c7ddec12495fdd" + integrity sha512-0O35DMR4d/ctuHL1Zo6mRUUzp0BoszKfeWsa6sCm/g70+S98+hEfTwZNDkQHylLxapiyjssF9uw/F+sXqejqLw== dependencies: - "@graphql-codegen/plugin-helpers" "^5.0.3" + "@graphql-codegen/plugin-helpers" "^5.0.4" "@graphql-codegen/schema-ast" "^4.0.2" - "@graphql-codegen/visitor-plugin-common" "5.1.0" + "@graphql-codegen/visitor-plugin-common" "5.3.1" auto-bind "~4.0.0" tslib "~2.6.0" @@ -3886,44 +4110,12 @@ parse-filepath "^1.0.2" tslib "~2.4.0" -"@graphql-codegen/visitor-plugin-common@4.0.1": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-4.0.1.tgz#64e293728b3c186f6767141e41fcdb310e50d367" - integrity sha512-Bi/1z0nHg4QMsAqAJhds+ForyLtk7A3HQOlkrZNm3xEkY7lcBzPtiOTLBtvziwopBsXUxqeSwVjOOFPLS5Yw1Q== - dependencies: - "@graphql-codegen/plugin-helpers" "^5.0.0" - "@graphql-tools/optimize" "^2.0.0" - "@graphql-tools/relay-operation-optimizer" "^7.0.0" - "@graphql-tools/utils" "^10.0.0" - auto-bind "~4.0.0" - change-case-all "1.0.15" - dependency-graph "^0.11.0" - graphql-tag "^2.11.0" - parse-filepath "^1.0.2" - tslib "~2.5.0" - -"@graphql-codegen/visitor-plugin-common@5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-5.1.0.tgz#4edf7edb53460e71762a5fd8bbf5269bc3d9200b" - integrity sha512-eamQxtA9bjJqI2lU5eYoA1GbdMIRT2X8m8vhWYsVQVWD3qM7sx/IqJU0kx0J3Vd4/CSd36BzL6RKwksibytDIg== - dependencies: - "@graphql-codegen/plugin-helpers" "^5.0.3" - "@graphql-tools/optimize" "^2.0.0" - "@graphql-tools/relay-operation-optimizer" "^7.0.0" - "@graphql-tools/utils" "^10.0.0" - auto-bind "~4.0.0" - change-case-all "1.0.15" - dependency-graph "^0.11.0" - graphql-tag "^2.11.0" - parse-filepath "^1.0.2" - tslib "~2.6.0" - -"@graphql-codegen/visitor-plugin-common@^4.0.0", "@graphql-codegen/visitor-plugin-common@^4.0.1": - version "4.1.2" - resolved "https://registry.yarnpkg.com/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-4.1.2.tgz#674c5d5813f6c00dd65e1ee148a62536879e65e2" - integrity sha512-yk7iEAL1kYZ2Gi/pvVjdsZhul5WsYEM4Zcgh2Ev15VicMdJmPHsMhNUsZWyVJV0CaQCYpNOFlGD/11Ea3pn4GA== +"@graphql-codegen/visitor-plugin-common@5.3.1", "@graphql-codegen/visitor-plugin-common@^5.0.0", "@graphql-codegen/visitor-plugin-common@^5.3.1": + version "5.3.1" + resolved "https://registry.yarnpkg.com/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-5.3.1.tgz#d3fb5f6336cbef58e2960471422da3f3caff7f17" + integrity sha512-MktoBdNZhSmugiDjmFl1z6rEUUaqyxtFJYWnDilE7onkPgyw//O0M+TuPBJPBWdyV6J2ond0Hdqtq+rkghgSIQ== dependencies: - "@graphql-codegen/plugin-helpers" "^5.0.3" + "@graphql-codegen/plugin-helpers" "^5.0.4" "@graphql-tools/optimize" "^2.0.0" "@graphql-tools/relay-operation-optimizer" "^7.0.0" "@graphql-tools/utils" "^10.0.0" @@ -4337,6 +4529,18 @@ jest-util "^25.5.0" slash "^3.0.0" +"@jest/console@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.7.0.tgz#cd4822dbdb84529265c5a2bdb529a3c9cc950ffc" + integrity sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg== + dependencies: + "@jest/types" "^29.6.3" + "@types/node" "*" + chalk "^4.0.0" + jest-message-util "^29.7.0" + jest-util "^29.7.0" + slash "^3.0.0" + "@jest/core@^25.5.4": version "25.5.4" resolved "https://registry.yarnpkg.com/@jest/core/-/core-25.5.4.tgz#3ef7412f7339210f003cdf36646bbca786efe7b4" @@ -4371,6 +4575,40 @@ slash "^3.0.0" strip-ansi "^6.0.0" +"@jest/core@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.7.0.tgz#b6cccc239f30ff36609658c5a5e2291757ce448f" + integrity sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg== + dependencies: + "@jest/console" "^29.7.0" + "@jest/reporters" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + ansi-escapes "^4.2.1" + chalk "^4.0.0" + ci-info "^3.2.0" + exit "^0.1.2" + graceful-fs "^4.2.9" + jest-changed-files "^29.7.0" + jest-config "^29.7.0" + jest-haste-map "^29.7.0" + jest-message-util "^29.7.0" + jest-regex-util "^29.6.3" + jest-resolve "^29.7.0" + jest-resolve-dependencies "^29.7.0" + jest-runner "^29.7.0" + jest-runtime "^29.7.0" + jest-snapshot "^29.7.0" + jest-util "^29.7.0" + jest-validate "^29.7.0" + jest-watcher "^29.7.0" + micromatch "^4.0.4" + pretty-format "^29.7.0" + slash "^3.0.0" + strip-ansi "^6.0.0" + "@jest/environment@^25.5.0": version "25.5.0" resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-25.5.0.tgz#aa33b0c21a716c65686638e7ef816c0e3a0c7b37" @@ -4380,13 +4618,31 @@ "@jest/types" "^25.5.0" jest-mock "^25.5.0" -"@jest/expect-utils@^29.6.2": +"@jest/environment@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.7.0.tgz#24d61f54ff1f786f3cd4073b4b94416383baf2a7" + integrity sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw== + dependencies: + "@jest/fake-timers" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + jest-mock "^29.7.0" + +"@jest/expect-utils@^29.6.2", "@jest/expect-utils@^29.7.0": version "29.7.0" resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.7.0.tgz#023efe5d26a8a70f21677d0a1afc0f0a44e3a1c6" integrity sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA== dependencies: jest-get-type "^29.6.3" +"@jest/expect@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.7.0.tgz#76a3edb0cb753b70dfbfe23283510d3d45432bf2" + integrity sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ== + dependencies: + expect "^29.7.0" + jest-snapshot "^29.7.0" + "@jest/fake-timers@^25.5.0": version "25.5.0" resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-25.5.0.tgz#46352e00533c024c90c2bc2ad9f2959f7f114185" @@ -4398,6 +4654,18 @@ jest-util "^25.5.0" lolex "^5.0.0" +"@jest/fake-timers@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.7.0.tgz#fd91bf1fffb16d7d0d24a426ab1a47a49881a565" + integrity sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ== + dependencies: + "@jest/types" "^29.6.3" + "@sinonjs/fake-timers" "^10.0.2" + "@types/node" "*" + jest-message-util "^29.7.0" + jest-mock "^29.7.0" + jest-util "^29.7.0" + "@jest/globals@^25.5.2": version "25.5.2" resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-25.5.2.tgz#5e45e9de8d228716af3257eeb3991cc2e162ca88" @@ -4407,6 +4675,16 @@ "@jest/types" "^25.5.0" expect "^25.5.0" +"@jest/globals@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.7.0.tgz#8d9290f9ec47ff772607fa864ca1d5a2efae1d4d" + integrity sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ== + dependencies: + "@jest/environment" "^29.7.0" + "@jest/expect" "^29.7.0" + "@jest/types" "^29.6.3" + jest-mock "^29.7.0" + "@jest/reporters@^25.5.1": version "25.5.1" resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-25.5.1.tgz#cb686bcc680f664c2dbaf7ed873e93aa6811538b" @@ -4439,6 +4717,36 @@ optionalDependencies: node-notifier "^6.0.0" +"@jest/reporters@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.7.0.tgz#04b262ecb3b8faa83b0b3d321623972393e8f4c7" + integrity sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg== + dependencies: + "@bcoe/v8-coverage" "^0.2.3" + "@jest/console" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" + "@jridgewell/trace-mapping" "^0.3.18" + "@types/node" "*" + chalk "^4.0.0" + collect-v8-coverage "^1.0.0" + exit "^0.1.2" + glob "^7.1.3" + graceful-fs "^4.2.9" + istanbul-lib-coverage "^3.0.0" + istanbul-lib-instrument "^6.0.0" + istanbul-lib-report "^3.0.0" + istanbul-lib-source-maps "^4.0.0" + istanbul-reports "^3.1.3" + jest-message-util "^29.7.0" + jest-util "^29.7.0" + jest-worker "^29.7.0" + slash "^3.0.0" + string-length "^4.0.1" + strip-ansi "^6.0.0" + v8-to-istanbul "^9.0.1" + "@jest/schemas@^29.6.3": version "29.6.3" resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.6.3.tgz#430b5ce8a4e0044a7e3819663305a7b3091c8e03" @@ -4455,6 +4763,15 @@ graceful-fs "^4.2.4" source-map "^0.6.0" +"@jest/source-map@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-29.6.3.tgz#d90ba772095cf37a34a5eb9413f1b562a08554c4" + integrity sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw== + dependencies: + "@jridgewell/trace-mapping" "^0.3.18" + callsites "^3.0.0" + graceful-fs "^4.2.9" + "@jest/test-result@^25.5.0": version "25.5.0" resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-25.5.0.tgz#139a043230cdeffe9ba2d8341b27f2efc77ce87c" @@ -4465,6 +4782,16 @@ "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" +"@jest/test-result@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.7.0.tgz#8db9a80aa1a097bb2262572686734baed9b1657c" + integrity sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA== + dependencies: + "@jest/console" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/istanbul-lib-coverage" "^2.0.0" + collect-v8-coverage "^1.0.0" + "@jest/test-sequencer@^25.5.4": version "25.5.4" resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-25.5.4.tgz#9b4e685b36954c38d0f052e596d28161bdc8b737" @@ -4476,6 +4803,16 @@ jest-runner "^25.5.4" jest-runtime "^25.5.4" +"@jest/test-sequencer@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz#6cef977ce1d39834a3aea887a1726628a6f072ce" + integrity sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw== + dependencies: + "@jest/test-result" "^29.7.0" + graceful-fs "^4.2.9" + jest-haste-map "^29.7.0" + slash "^3.0.0" + "@jest/transform@^25.5.1": version "25.5.1" resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-25.5.1.tgz#0469ddc17699dd2bf985db55fa0fb9309f5c2db3" @@ -4519,7 +4856,7 @@ source-map "^0.6.1" write-file-atomic "^3.0.0" -"@jest/transform@^29.6.2": +"@jest/transform@^29.7.0": version "29.7.0" resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.7.0.tgz#df2dd9c346c7d7768b8a06639994640c642e284c" integrity sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw== @@ -7010,6 +7347,20 @@ dependencies: type-detect "4.0.8" +"@sinonjs/commons@^3.0.0": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-3.0.1.tgz#1029357e44ca901a615585f6d27738dbc89084cd" + integrity sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ== + dependencies: + type-detect "4.0.8" + +"@sinonjs/fake-timers@^10.0.2": + version "10.3.0" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz#55fdff1ecab9f354019129daf4df0dd4d923ea66" + integrity sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA== + dependencies: + "@sinonjs/commons" "^3.0.0" + "@slorber/remark-comment@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@slorber/remark-comment/-/remark-comment-1.0.0.tgz#2a020b3f4579c89dec0361673206c28d67e08f5a" @@ -9548,6 +9899,11 @@ dependencies: "@types/node" "*" +"@types/cookiejar@^2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@types/cookiejar/-/cookiejar-2.1.5.tgz#14a3e83fa641beb169a2dd8422d91c3c345a9a78" + integrity sha512-he+DHOWReW0nghN24E1WUqM0efK4kI9oTqDm6XmK8ZPe2djZ90BSNdGnIyCLzCPw7/pogPlGbzI2wHGGmi4O/Q== + "@types/d3-array@3.0.3": version "3.0.3" resolved "https://registry.yarnpkg.com/@types/d3-array/-/d3-array-3.0.3.tgz#87d990bf504d14ad6b16766979d04e943c046dac" @@ -9957,6 +10313,11 @@ resolved "https://registry.yarnpkg.com/@types/mdx/-/mdx-2.0.13.tgz#68f6877043d377092890ff5b298152b0a21671bd" integrity sha512-+OWZQfAYyio6YkJb3HLxDrvnx6SWWDbC0zVPfBRzUk0/nqoDyf6dNxQi3eArPe8rJ473nobTMQ/8Zk+LxJ+Yuw== +"@types/methods@^1.1.4": + version "1.1.4" + resolved "https://registry.yarnpkg.com/@types/methods/-/methods-1.1.4.tgz#d3b7ac30ac47c91054ea951ce9eed07b1051e547" + integrity sha512-ymXWVrDiCxTBE3+RIrrP533E70eA+9qu7zdWoHuOmGujkYtzf4HQF96b8nwHLqhuf4ykX61IGRIB38CC6/sImQ== + "@types/mime@^1": version "1.3.5" resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.5.tgz#1ef302e01cf7d2b5a0fa526790c9123bf1d06690" @@ -10283,6 +10644,24 @@ resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.3.tgz#6209321eb2c1712a7e7466422b8cb1fc0d9dd5d8" integrity sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw== +"@types/superagent@^8.1.0": + version "8.1.9" + resolved "https://registry.yarnpkg.com/@types/superagent/-/superagent-8.1.9.tgz#28bfe4658e469838ed0bf66d898354bcab21f49f" + integrity sha512-pTVjI73witn+9ILmoJdajHGW2jkSaOzhiFYF1Rd3EQ94kymLqB9PjD9ISg7WaALC7+dCHT0FGe9T2LktLq/3GQ== + dependencies: + "@types/cookiejar" "^2.1.5" + "@types/methods" "^1.1.4" + "@types/node" "*" + form-data "^4.0.0" + +"@types/supertest@^6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@types/supertest/-/supertest-6.0.2.tgz#2af1c466456aaf82c7c6106c6b5cbd73a5e86588" + integrity sha512-137ypx2lk/wTQbW6An6safu9hXmajAifU/s7szAHLN/FeIm5w7yR0Wkl9fdJMRSHwOn4HLAI0DaB2TOORuhPDg== + dependencies: + "@types/methods" "^1.1.4" + "@types/superagent" "^8.1.0" + "@types/tapable@^1", "@types/tapable@^1.0.5": version "1.0.12" resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-1.0.12.tgz#bc2cab12e87978eee89fb21576b670350d6d86ab" @@ -12620,7 +12999,7 @@ babel-eslint@^10.0.3: eslint-visitor-keys "^1.0.0" resolve "^1.12.0" -babel-jest@^25.5.1: +babel-jest@^25.2.6, babel-jest@^25.5.1: version "25.5.1" resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-25.5.1.tgz#bc2e6101f849d6f6aec09720ffc7bc5332e62853" integrity sha512-9dA9+GmMjIzgPnYtkhBg73gOo/RHqPmLruP3BaGL4KEX3Dwz6pI8auSN8G8+iuEG90+GSswyKvslN+JYSaacaQ== @@ -12634,15 +13013,15 @@ babel-jest@^25.5.1: graceful-fs "^4.2.4" slash "^3.0.0" -babel-jest@^29.4.1: - version "29.6.2" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.6.2.tgz#cada0a59e07f5acaeb11cbae7e3ba92aec9c1126" - integrity sha512-BYCzImLos6J3BH/+HvUCHG1dTf2MzmAB4jaVxHV+29RZLjR29XuYTmsf2sdDwkrb+FczkGo3kOhE7ga6sI0P4A== +babel-jest@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.7.0.tgz#f4369919225b684c56085998ac63dbd05be020d5" + integrity sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg== dependencies: - "@jest/transform" "^29.6.2" + "@jest/transform" "^29.7.0" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" - babel-preset-jest "^29.5.0" + babel-preset-jest "^29.6.3" chalk "^4.0.0" graceful-fs "^4.2.9" slash "^3.0.0" @@ -12930,7 +13309,7 @@ babel-preset-jest@^25.5.0: babel-plugin-jest-hoist "^25.5.0" babel-preset-current-node-syntax "^0.1.2" -babel-preset-jest@^29.5.0: +babel-preset-jest@^29.6.3: version "29.6.3" resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz#fa05fa510e7d493896d7b0dd2033601c840f171c" integrity sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA== @@ -13383,6 +13762,16 @@ browserslist@^4.0.0, browserslist@^4.12.0, browserslist@^4.18.1, browserslist@^4 node-releases "^2.0.14" update-browserslist-db "^1.0.13" +browserslist@^4.23.1: + version "4.23.2" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.23.2.tgz#244fe803641f1c19c28c48c4b6ec9736eb3d32ed" + integrity sha512-qkqSyistMYdxAcw+CzbZwlBy8AGmS/eEWs+sEV5TnLRGDOL+C5M2EnH6tlZyg0YoAxGJAFKh61En9BR941GnHA== + dependencies: + caniuse-lite "^1.0.30001640" + electron-to-chromium "^1.4.820" + node-releases "^2.0.14" + update-browserslist-db "^1.1.0" + bs-logger@0.x: version "0.2.6" resolved "https://registry.yarnpkg.com/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8" @@ -13807,6 +14196,11 @@ caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001406, can resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001599.tgz#571cf4f3f1506df9bf41fcbb6d10d5d017817bce" integrity sha512-LRAQHZ4yT1+f9LemSMeqdMpMxZcc4RMWdj4tiFe3G8tNkWK+E58g+/tzotb5cU6TbcVJLr4fySiAW7XmxQvZQA== +caniuse-lite@^1.0.30001640: + version "1.0.30001643" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001643.tgz#9c004caef315de9452ab970c3da71085f8241dbd" + integrity sha512-ERgWGNleEilSrHM6iUz/zJNSQTP8Mr21wDWpdgvRwcTXGAq6jMtOUPP4dqFPTdKqZ2wKTdtB+uucZ3MRpAUSmg== + capital-case@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/capital-case/-/capital-case-1.0.4.tgz#9d130292353c9249f6b00fa5852bee38a717e669" @@ -14207,6 +14601,11 @@ cjs-module-lexer@1.2.3: resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz#6c370ab19f8a3394e318fe682686ec0ac684d107" integrity sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ== +cjs-module-lexer@^1.0.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.3.1.tgz#c485341ae8fd999ca4ee5af2d7a1c9ae01e0099c" + integrity sha512-a3KdPAANPbNE4ZUv9h6LckSl9zLsYOP4MBmhIPkRaeyybt+r4UghLvq+xw/YwUcC1gqylCkL4rdVs3Lwupjm4Q== + class-is@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/class-is/-/class-is-1.1.0.tgz#9d3c0fba0440d211d843cec3dedfa48055005825" @@ -15186,6 +15585,19 @@ create-hmac@^1.1.0, create-hmac@^1.1.4, create-hmac@^1.1.7: safe-buffer "^5.0.1" sha.js "^2.4.8" +create-jest@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/create-jest/-/create-jest-29.7.0.tgz#a355c5b3cb1e1af02ba177fe7afd7feee49a5320" + integrity sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q== + dependencies: + "@jest/types" "^29.6.3" + chalk "^4.0.0" + exit "^0.1.2" + graceful-fs "^4.2.9" + jest-config "^29.7.0" + jest-util "^29.7.0" + prompts "^2.0.1" + create-require@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" @@ -15982,6 +16394,11 @@ dedent@^0.7.0: resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" integrity sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA== +dedent@^1.0.0: + version "1.5.3" + resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.5.3.tgz#99aee19eb9bae55a67327717b6e848d0bf777e5a" + integrity sha512-NHQtfOOW68WD8lgypbLA5oT+Bt0xXJhiYvoR6SmmNXZfpzOGXwdKWmcwG8N7PwVVWV3eF/68nmD9BaJSsTBhyQ== + deep-eql@^4.1.3: version "4.1.3" resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-4.1.3.tgz#7c7775513092f7df98d8df9996dd085eb668cc6d" @@ -16762,6 +17179,11 @@ electron-to-chromium@^1.4.668: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.714.tgz#708fdc8d5bdec824e41fe8b1b0e10af508a10946" integrity sha512-OfnVHt+nMRH9Ua5koH/2gKlCAXbG+u1yXwLKyBVqNboBV34ZTwb846RUe8K5mtE1uhz0BXoMarZ13JCQr+sBtQ== +electron-to-chromium@^1.4.820: + version "1.5.0" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.0.tgz#0d3123a9f09189b9c7ab4b5d6848d71b3c1fd0e8" + integrity sha512-Vb3xHHYnLseK8vlMJQKJYXJ++t4u1/qJ3vykuVrVjvdiOEhYyT1AuP4x03G8EnPmYvYOhe9T+dADTmthjRQMkA== + elliptic@6.5.4: version "6.5.4" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" @@ -16788,6 +17210,11 @@ elliptic@^6.4.0, elliptic@^6.5.2, elliptic@^6.5.3, elliptic@^6.5.4, elliptic@^6. minimalistic-assert "^1.0.1" minimalistic-crypto-utils "^1.0.1" +emittery@^0.13.1: + version "0.13.1" + resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.13.1.tgz#c04b8c3457490e0847ae51fced3af52d338e3dad" + integrity sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ== + emoji-regex@^7.0.1: version "7.0.3" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" @@ -17412,7 +17839,7 @@ esbuild@^0.15.3: esbuild-windows-64 "0.15.18" esbuild-windows-arm64 "0.15.18" -escalade@^3.1.1: +escalade@^3.1.1, escalade@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.2.tgz#54076e9ab29ea5bf3d8f1ed62acffbb88272df27" integrity sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA== @@ -18575,6 +19002,17 @@ expect@^29.0.0: jest-message-util "^29.6.2" jest-util "^29.6.2" +expect@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.7.0.tgz#578874590dcb3214514084c08115d8aee61e11bc" + integrity sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw== + dependencies: + "@jest/expect-utils" "^29.7.0" + jest-get-type "^29.6.3" + jest-matcher-utils "^29.7.0" + jest-message-util "^29.7.0" + jest-util "^29.7.0" + express@^4.14.0, express@^4.17.1, express@^4.18.2: version "4.19.1" resolved "https://registry.yarnpkg.com/express/-/express-4.19.1.tgz#4700635795e911600a45596138cf5b0320e78256" @@ -22471,6 +22909,17 @@ istanbul-lib-instrument@^5.0.4: istanbul-lib-coverage "^3.2.0" semver "^6.3.0" +istanbul-lib-instrument@^6.0.0: + version "6.0.3" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz#fa15401df6c15874bcb2105f773325d78c666765" + integrity sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q== + dependencies: + "@babel/core" "^7.23.9" + "@babel/parser" "^7.23.9" + "@istanbuljs/schema" "^0.1.3" + istanbul-lib-coverage "^3.2.0" + semver "^7.5.4" + istanbul-lib-processinfo@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.3.tgz#366d454cd0dcb7eb6e0e419378e60072c8626169" @@ -22509,6 +22958,14 @@ istanbul-reports@^3.0.2, istanbul-reports@^3.1.4: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" +istanbul-reports@^3.1.3: + version "3.1.7" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.7.tgz#daed12b9e1dca518e15c056e1e537e741280fa0b" + integrity sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g== + dependencies: + html-escaper "^2.0.0" + istanbul-lib-report "^3.0.0" + isurl@^1.0.0-alpha5: version "1.0.0" resolved "https://registry.yarnpkg.com/isurl/-/isurl-1.0.0.tgz#b27f4f49f3cdaa3ea44a0a5b7f3462e6edc39d67" @@ -22559,6 +23016,41 @@ jest-changed-files@^25.5.0: execa "^3.2.0" throat "^5.0.0" +jest-changed-files@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.7.0.tgz#1c06d07e77c78e1585d020424dedc10d6e17ac3a" + integrity sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w== + dependencies: + execa "^5.0.0" + jest-util "^29.7.0" + p-limit "^3.1.0" + +jest-circus@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.7.0.tgz#b6817a45fcc835d8b16d5962d0c026473ee3668a" + integrity sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw== + dependencies: + "@jest/environment" "^29.7.0" + "@jest/expect" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + chalk "^4.0.0" + co "^4.6.0" + dedent "^1.0.0" + is-generator-fn "^2.0.0" + jest-each "^29.7.0" + jest-matcher-utils "^29.7.0" + jest-message-util "^29.7.0" + jest-runtime "^29.7.0" + jest-snapshot "^29.7.0" + jest-util "^29.7.0" + p-limit "^3.1.0" + pretty-format "^29.7.0" + pure-rand "^6.0.0" + slash "^3.0.0" + stack-utils "^2.0.3" + jest-cli@^25.5.4: version "25.5.4" resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-25.5.4.tgz#b9f1a84d1301a92c5c217684cb79840831db9f0d" @@ -22579,6 +23071,23 @@ jest-cli@^25.5.4: realpath-native "^2.0.0" yargs "^15.3.1" +jest-cli@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.7.0.tgz#5592c940798e0cae677eec169264f2d839a37995" + integrity sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg== + dependencies: + "@jest/core" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/types" "^29.6.3" + chalk "^4.0.0" + create-jest "^29.7.0" + exit "^0.1.2" + import-local "^3.0.2" + jest-config "^29.7.0" + jest-util "^29.7.0" + jest-validate "^29.7.0" + yargs "^17.3.1" + jest-config@^25.5.4: version "25.5.4" resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-25.5.4.tgz#38e2057b3f976ef7309b2b2c8dcd2a708a67f02c" @@ -22604,6 +23113,34 @@ jest-config@^25.5.4: pretty-format "^25.5.0" realpath-native "^2.0.0" +jest-config@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.7.0.tgz#bcbda8806dbcc01b1e316a46bb74085a84b0245f" + integrity sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ== + dependencies: + "@babel/core" "^7.11.6" + "@jest/test-sequencer" "^29.7.0" + "@jest/types" "^29.6.3" + babel-jest "^29.7.0" + chalk "^4.0.0" + ci-info "^3.2.0" + deepmerge "^4.2.2" + glob "^7.1.3" + graceful-fs "^4.2.9" + jest-circus "^29.7.0" + jest-environment-node "^29.7.0" + jest-get-type "^29.6.3" + jest-regex-util "^29.6.3" + jest-resolve "^29.7.0" + jest-runner "^29.7.0" + jest-util "^29.7.0" + jest-validate "^29.7.0" + micromatch "^4.0.4" + parse-json "^5.2.0" + pretty-format "^29.7.0" + slash "^3.0.0" + strip-json-comments "^3.1.1" + jest-diff@^24.3.0: version "24.9.0" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.9.0.tgz#931b7d0d5778a1baf7452cb816e325e3724055da" @@ -22641,6 +23178,13 @@ jest-docblock@^25.3.0: dependencies: detect-newline "^3.0.0" +jest-docblock@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-29.7.0.tgz#8fddb6adc3cdc955c93e2a87f61cfd350d5d119a" + integrity sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g== + dependencies: + detect-newline "^3.0.0" + jest-each@^25.5.0: version "25.5.0" resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-25.5.0.tgz#0c3c2797e8225cb7bec7e4d249dcd96b934be516" @@ -22652,6 +23196,17 @@ jest-each@^25.5.0: jest-util "^25.5.0" pretty-format "^25.5.0" +jest-each@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.7.0.tgz#162a9b3f2328bdd991beaabffbb74745e56577d1" + integrity sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ== + dependencies: + "@jest/types" "^29.6.3" + chalk "^4.0.0" + jest-get-type "^29.6.3" + jest-util "^29.7.0" + pretty-format "^29.7.0" + jest-environment-jsdom@^25.5.0: version "25.5.0" resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-25.5.0.tgz#dcbe4da2ea997707997040ecf6e2560aec4e9834" @@ -22676,6 +23231,18 @@ jest-environment-node@^25.5.0: jest-util "^25.5.0" semver "^6.3.0" +jest-environment-node@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.7.0.tgz#0b93e111dda8ec120bc8300e6d1fb9576e164376" + integrity sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw== + dependencies: + "@jest/environment" "^29.7.0" + "@jest/fake-timers" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + jest-mock "^29.7.0" + jest-util "^29.7.0" + jest-fetch-mock@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/jest-fetch-mock/-/jest-fetch-mock-3.0.3.tgz#31749c456ae27b8919d69824f1c2bd85fe0a1f3b" @@ -22790,6 +23357,14 @@ jest-leak-detector@^25.5.0: jest-get-type "^25.2.6" pretty-format "^25.5.0" +jest-leak-detector@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz#5b7ec0dadfdfec0ca383dc9aa016d36b5ea4c728" + integrity sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw== + dependencies: + jest-get-type "^29.6.3" + pretty-format "^29.7.0" + jest-matcher-utils@^25.5.0: version "25.5.0" resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-25.5.0.tgz#fbc98a12d730e5d2453d7f1ed4a4d948e34b7867" @@ -22800,7 +23375,7 @@ jest-matcher-utils@^25.5.0: jest-get-type "^25.2.6" pretty-format "^25.5.0" -jest-matcher-utils@^29.6.2: +jest-matcher-utils@^29.6.2, jest-matcher-utils@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz#ae8fec79ff249fd592ce80e3ee474e83a6c44f12" integrity sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g== @@ -22824,7 +23399,7 @@ jest-message-util@^25.5.0: slash "^3.0.0" stack-utils "^1.0.1" -jest-message-util@^29.6.2: +jest-message-util@^29.6.2, jest-message-util@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.7.0.tgz#8bc392e204e95dfe7564abbe72a404e28e51f7f3" integrity sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w== @@ -22861,7 +23436,16 @@ jest-mock@^27.0.6: "@jest/types" "^27.5.1" "@types/node" "*" -jest-pnp-resolver@^1.2.1: +jest-mock@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.7.0.tgz#4e836cf60e99c6fcfabe9f99d017f3fdd50a6347" + integrity sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw== + dependencies: + "@jest/types" "^29.6.3" + "@types/node" "*" + jest-util "^29.7.0" + +jest-pnp-resolver@^1.2.1, jest-pnp-resolver@^1.2.2: version "1.2.3" resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz#930b1546164d4ad5937d5540e711d4d38d4cad2e" integrity sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w== @@ -22890,6 +23474,14 @@ jest-resolve-dependencies@^25.5.4: jest-regex-util "^25.2.6" jest-snapshot "^25.5.1" +jest-resolve-dependencies@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz#1b04f2c095f37fc776ff40803dc92921b1e88428" + integrity sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA== + dependencies: + jest-regex-util "^29.6.3" + jest-snapshot "^29.7.0" + jest-resolve@^25.5.1: version "25.5.1" resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-25.5.1.tgz#0e6fbcfa7c26d2a5fe8f456088dc332a79266829" @@ -22905,6 +23497,21 @@ jest-resolve@^25.5.1: resolve "^1.17.0" slash "^3.0.0" +jest-resolve@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.7.0.tgz#64d6a8992dd26f635ab0c01e5eef4399c6bcbc30" + integrity sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA== + dependencies: + chalk "^4.0.0" + graceful-fs "^4.2.9" + jest-haste-map "^29.7.0" + jest-pnp-resolver "^1.2.2" + jest-util "^29.7.0" + jest-validate "^29.7.0" + resolve "^1.20.0" + resolve.exports "^2.0.0" + slash "^3.0.0" + jest-runner@^25.5.4: version "25.5.4" resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-25.5.4.tgz#ffec5df3875da5f5c878ae6d0a17b8e4ecd7c71d" @@ -22930,6 +23537,33 @@ jest-runner@^25.5.4: source-map-support "^0.5.6" throat "^5.0.0" +jest-runner@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.7.0.tgz#809af072d408a53dcfd2e849a4c976d3132f718e" + integrity sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ== + dependencies: + "@jest/console" "^29.7.0" + "@jest/environment" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + chalk "^4.0.0" + emittery "^0.13.1" + graceful-fs "^4.2.9" + jest-docblock "^29.7.0" + jest-environment-node "^29.7.0" + jest-haste-map "^29.7.0" + jest-leak-detector "^29.7.0" + jest-message-util "^29.7.0" + jest-resolve "^29.7.0" + jest-runtime "^29.7.0" + jest-util "^29.7.0" + jest-watcher "^29.7.0" + jest-worker "^29.7.0" + p-limit "^3.1.0" + source-map-support "0.5.13" + jest-runtime@^25.5.4: version "25.5.4" resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-25.5.4.tgz#dc981fe2cb2137abcd319e74ccae7f7eeffbfaab" @@ -22962,6 +23596,34 @@ jest-runtime@^25.5.4: strip-bom "^4.0.0" yargs "^15.3.1" +jest-runtime@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.7.0.tgz#efecb3141cf7d3767a3a0cc8f7c9990587d3d817" + integrity sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ== + dependencies: + "@jest/environment" "^29.7.0" + "@jest/fake-timers" "^29.7.0" + "@jest/globals" "^29.7.0" + "@jest/source-map" "^29.6.3" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + chalk "^4.0.0" + cjs-module-lexer "^1.0.0" + collect-v8-coverage "^1.0.0" + glob "^7.1.3" + graceful-fs "^4.2.9" + jest-haste-map "^29.7.0" + jest-message-util "^29.7.0" + jest-mock "^29.7.0" + jest-regex-util "^29.6.3" + jest-resolve "^29.7.0" + jest-snapshot "^29.7.0" + jest-util "^29.7.0" + slash "^3.0.0" + strip-bom "^4.0.0" + jest-serializer@^25.5.0: version "25.5.0" resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-25.5.0.tgz#a993f484e769b4ed54e70e0efdb74007f503072b" @@ -22998,6 +23660,32 @@ jest-snapshot@^25.5.1: pretty-format "^25.5.0" semver "^6.3.0" +jest-snapshot@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.7.0.tgz#c2c574c3f51865da1bb329036778a69bf88a6be5" + integrity sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw== + dependencies: + "@babel/core" "^7.11.6" + "@babel/generator" "^7.7.2" + "@babel/plugin-syntax-jsx" "^7.7.2" + "@babel/plugin-syntax-typescript" "^7.7.2" + "@babel/types" "^7.3.3" + "@jest/expect-utils" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" + babel-preset-current-node-syntax "^1.0.0" + chalk "^4.0.0" + expect "^29.7.0" + graceful-fs "^4.2.9" + jest-diff "^29.7.0" + jest-get-type "^29.6.3" + jest-matcher-utils "^29.7.0" + jest-message-util "^29.7.0" + jest-util "^29.7.0" + natural-compare "^1.4.0" + pretty-format "^29.7.0" + semver "^7.5.3" + jest-util@^25.5.0: version "25.5.0" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-25.5.0.tgz#31c63b5d6e901274d264a4fec849230aa3fa35b0" @@ -23045,6 +23733,18 @@ jest-validate@^25.5.0: leven "^3.1.0" pretty-format "^25.5.0" +jest-validate@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.7.0.tgz#7bf705511c64da591d46b15fce41400d52147d9c" + integrity sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw== + dependencies: + "@jest/types" "^29.6.3" + camelcase "^6.2.0" + chalk "^4.0.0" + jest-get-type "^29.6.3" + leven "^3.1.0" + pretty-format "^29.7.0" + jest-watch-typeahead@^0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/jest-watch-typeahead/-/jest-watch-typeahead-0.5.0.tgz#903dba6112f22daae7e90b0a271853f7ff182008" @@ -23070,6 +23770,20 @@ jest-watcher@^25.2.4, jest-watcher@^25.5.0: jest-util "^25.5.0" string-length "^3.1.0" +jest-watcher@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.7.0.tgz#7810d30d619c3a62093223ce6bb359ca1b28a2f2" + integrity sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g== + dependencies: + "@jest/test-result" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + ansi-escapes "^4.2.1" + chalk "^4.0.0" + emittery "^0.13.1" + jest-util "^29.7.0" + string-length "^4.0.1" + jest-worker@^24.9.0: version "24.9.0" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.9.0.tgz#5dbfdb5b2d322e98567898238a9697bcce67b3e5" @@ -23123,6 +23837,16 @@ jest@^25.3.0: import-local "^3.0.2" jest-cli "^25.5.4" +jest@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-29.7.0.tgz#994676fc24177f088f1c5e3737f5697204ff2613" + integrity sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw== + dependencies: + "@jest/core" "^29.7.0" + "@jest/types" "^29.6.3" + import-local "^3.0.2" + jest-cli "^29.7.0" + jiti@^1.17.1, jiti@^1.18.2, jiti@^1.19.1, jiti@^1.20.0, jiti@^1.21.0: version "1.21.0" resolved "https://registry.yarnpkg.com/jiti/-/jiti-1.21.0.tgz#7c97f8fe045724e136a397f7340475244156105d" @@ -27490,7 +28214,7 @@ p-is-promise@^1.1.0: resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-1.1.0.tgz#9c9456989e9f6588017b0434d56097675c3da05e" integrity sha512-zL7VE4JVS2IFSkR2GQKDSPEVxkoH43/p7oEnwpdCndKYJO0HVeRB7fA8TJwuLOTBREtK0ea8eHaxdwcpob5dmg== -p-limit@3.1.0, p-limit@^3.0.2: +p-limit@3.1.0, p-limit@^3.0.2, p-limit@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== @@ -28121,6 +28845,11 @@ picocolors@^0.2.1: resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-0.2.1.tgz#570670f793646851d1ba135996962abad587859f" integrity sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA== +picocolors@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.1.tgz#a8ad579b571952f0e5d25892de5445bcfe25aaa1" + integrity sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew== + picomatch@^2.0.4, picomatch@^2.0.7, picomatch@^2.2.1, picomatch@^2.2.2, picomatch@^2.2.3, picomatch@^2.3.0, picomatch@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" @@ -29388,6 +30117,11 @@ pupa@^3.1.0: dependencies: escape-goat "^4.0.0" +pure-rand@^6.0.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-6.1.0.tgz#d173cf23258231976ccbdb05247c9787957604f2" + integrity sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA== + pvtsutils@^1.3.2: version "1.3.3" resolved "https://registry.yarnpkg.com/pvtsutils/-/pvtsutils-1.3.3.tgz#29ef8ea50318d1187b15260b1d0b32e57eea32dc" @@ -30868,6 +31602,11 @@ resolve-url@^0.2.1: resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" integrity sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg== +resolve.exports@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-2.0.2.tgz#f8c934b8e6a13f539e38b7098e2e36134f01e800" + integrity sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg== + resolve@1.1.7, resolve@1.1.x: version "1.1.7" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" @@ -32270,6 +33009,14 @@ source-map-resolve@^0.6.0: atob "^2.1.2" decode-uri-component "^0.2.0" +source-map-support@0.5.13: + version "0.5.13" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932" + integrity sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + source-map-support@^0.5.13, source-map-support@^0.5.16, source-map-support@^0.5.6, source-map-support@~0.5.12, source-map-support@~0.5.20: version "0.5.21" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" @@ -32735,6 +33482,14 @@ string-length@^3.1.0: astral-regex "^1.0.0" strip-ansi "^5.2.0" +string-length@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-4.0.2.tgz#a8a8dc7bd5c1a82b9b3c8b87e125f66871b6e57a" + integrity sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ== + dependencies: + char-regex "^1.0.2" + strip-ansi "^6.0.0" + "string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" @@ -34195,11 +34950,6 @@ tslib@~2.4.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.1.tgz#0d0bfbaac2880b91e22df0768e55be9753a5b17e" integrity sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA== -tslib@~2.5.0: - version "2.5.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.3.tgz#24944ba2d990940e6e982c4bea147aba80209913" - integrity sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w== - tsort@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/tsort/-/tsort-0.0.1.tgz#e2280f5e817f8bf4275657fd0f9aebd44f5a2786" @@ -34980,6 +35730,14 @@ update-browserslist-db@^1.0.13: escalade "^3.1.1" picocolors "^1.0.0" +update-browserslist-db@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz#7ca61c0d8650766090728046e416a8cde682859e" + integrity sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ== + dependencies: + escalade "^3.1.2" + picocolors "^1.0.1" + update-notifier@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-6.0.2.tgz#a6990253dfe6d5a02bd04fbb6a61543f55026b60" @@ -35240,6 +35998,11 @@ uuid@^9.0.0, uuid@^9.0.1: resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30" integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA== +uuidv7@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/uuidv7/-/uuidv7-1.0.1.tgz#43c8d4329a2a1b403c8815c03f4770e531ae0151" + integrity sha512-2noB909GbI352dKfASOY6VHHl59KvevZ1FF8gCAXCwDyrt2kkZhuFbczF9udqTfeejiRYEmO4wzUZ0WhVP+IUA== + uvu@^0.5.0: version "0.5.6" resolved "https://registry.yarnpkg.com/uvu/-/uvu-0.5.6.tgz#2754ca20bcb0bb59b64e9985e84d2e81058502df" @@ -35278,6 +36041,15 @@ v8-to-istanbul@^9.0.0: "@types/istanbul-lib-coverage" "^2.0.1" convert-source-map "^1.6.0" +v8-to-istanbul@^9.0.1: + version "9.3.0" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz#b9572abfa62bd556c16d75fdebc1a411d5ff3175" + integrity sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA== + dependencies: + "@jridgewell/trace-mapping" "^0.3.12" + "@types/istanbul-lib-coverage" "^2.0.1" + convert-source-map "^2.0.0" + validate-npm-package-license@^3.0.1, validate-npm-package-license@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" @@ -37178,7 +37950,7 @@ yargs@^15.0.2, yargs@^15.1.0, yargs@^15.3.1: y18n "^4.0.0" yargs-parser "^18.1.2" -yargs@^17.0.0, yargs@^17.0.1, yargs@^17.5.1, yargs@^17.6.2, yargs@^17.7.2: +yargs@^17.0.0, yargs@^17.0.1, yargs@^17.3.1, yargs@^17.5.1, yargs@^17.6.2, yargs@^17.7.2: version "17.7.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==