diff --git a/go.mod b/go.mod index 22756a2..017495b 100644 --- a/go.mod +++ b/go.mod @@ -3,8 +3,7 @@ module nft-collect go 1.19 require ( - github.com/allegro/bigcache/v3 v3.1.0 - github.com/chenyahui/gin-cache v1.8.0 + github.com/blocto/solana-go-sdk v1.26.0 github.com/ethereum/go-ethereum v1.10.26 github.com/fsnotify/fsnotify v1.6.0 github.com/fvbock/endless v0.0.0-20170109170031-447134032cb6 @@ -25,18 +24,17 @@ require ( ) require ( + filippo.io/edwards25519 v1.0.0-rc.1 // indirect github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/deckarep/golang-set v1.8.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect - github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/gin-contrib/sse v0.1.0 // indirect github.com/go-ole/go-ole v1.2.1 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-playground/validator/v10 v10.11.2 // indirect - github.com/go-redis/redis/v8 v8.11.5 // indirect github.com/go-stack/stack v1.8.0 // indirect github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect github.com/goccy/go-json v0.10.0 // indirect @@ -51,7 +49,6 @@ require ( github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect github.com/jackc/pgx/v5 v5.2.0 // indirect - github.com/jellydator/ttlcache/v2 v2.11.1 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.5 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -95,7 +92,6 @@ require ( golang.org/x/crypto v0.6.0 // indirect golang.org/x/mod v0.6.0 // indirect golang.org/x/net v0.7.0 // indirect - golang.org/x/sync v0.1.0 // indirect golang.org/x/sys v0.5.0 // indirect golang.org/x/text v0.7.0 // indirect golang.org/x/tools v0.2.0 // indirect diff --git a/go.sum b/go.sum index bc0081c..9af9916 100644 --- a/go.sum +++ b/go.sum @@ -36,25 +36,24 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= +filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 h1:fLjPD/aNc3UIOA6tDi6QXUemppXK3P9BI7mr2hd6gx8= github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/VictoriaMetrics/fastcache v1.6.0 h1:C/3Oi3EiBCqufydp1neRZkqcwmEiuRT9c3fqvvgKm5o= -github.com/allegro/bigcache/v3 v3.1.0 h1:H2Vp8VOvxcrB91o86fUSVJFqeuz8kpyyB02eH3bSzwk= -github.com/allegro/bigcache/v3 v3.1.0/go.mod h1:aPyh7jEvrog9zAwx5N7+JUQX5dZTSGpxF1LAR4dr35I= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= +github.com/blocto/solana-go-sdk v1.26.0 h1:NpLKmP89TPbX35U07kFgfcTibLFcb69NK0wYgEwLfTM= +github.com/blocto/solana-go-sdk v1.26.0/go.mod h1:Xoyhhb3hrGpEQ5rJps5a3OgMwDpmEhrd9bgzFKkkwMs= github.com/btcsuite/btcd/btcec/v2 v2.2.0 h1:fzn1qaOt32TuLjFlkzYSsBC35Q3KUjT1SwPxiMSCF5k= github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chenyahui/gin-cache v1.8.0 h1:OnjQcUOLUfhVhQjMNfZSLbSgcPzEnOsKQS52Gh2JQiI= -github.com/chenyahui/gin-cache v1.8.0/go.mod h1:eEAwR4874QJI3dY7rdkoartzwVD0e1iq8wEJaEbzA64= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= @@ -73,8 +72,6 @@ github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/edsrzf/mmap-go v1.0.0 h1:CEBF7HpRnUCSJgGUb5h1Gm7e3VkmVDrR8lvWVLtrOFw= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -86,8 +83,6 @@ github.com/ethereum/go-ethereum v1.10.26 h1:i/7d9RBBwiXCEuyduBQzJw/mKmnvzsN14jqB github.com/ethereum/go-ethereum v1.10.26/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/fvbock/endless v0.0.0-20170109170031-447134032cb6 h1:6VSn3hB5U5GeA6kQw4TwWIWbOhtvR2hmbBJnTOtqTWc= @@ -97,7 +92,6 @@ github.com/gin-contrib/pprof v1.4.0 h1:XxiBSf5jWZ5i16lNOPbMTVdgHBdhfGRD5PZ1LWazz github.com/gin-contrib/pprof v1.4.0/go.mod h1:RrehPJasUVBPK6yTUwOl8/NP6i0vbUgmxtis+Z5KE90= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.7.7/go.mod h1:axIBovoeJpVj8S3BwE0uPMTeReE4+AfFtqpqaZ1qq1U= github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= github.com/gin-gonic/gin v1.8.2 h1:UzKToD9/PoFj/V4rvlKqTRKnQYyz8Sc1MJlv4JHPtvY= github.com/gin-gonic/gin v1.8.2/go.mod h1:qw5AYuDrzRTnhvusDsrov+fDIxp9Dleuu12h8nfB398= @@ -108,21 +102,15 @@ github.com/go-ole/go-ole v1.2.1 h1:2lOsA72HgjxAuMlKpFiCbHTvu44PIVkZ5hqm3RSdI/E= github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= -github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= -github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU= github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= -github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Pxt6RJr792+w= -github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= -github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= @@ -161,7 +149,6 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -175,7 +162,6 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 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.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= @@ -215,7 +201,6 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= github.com/holiman/uint256 v1.2.0 h1:gpSYcPLWGv4sG43I2mVLiDZCNDh/EpGjSk8tmtxitHM= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= @@ -232,14 +217,11 @@ github.com/jackc/pgx/v5 v5.2.0 h1:NdPpngX0Y6z6XDFKqmFQaE+bCtkqzvQIOt1wvBlAqs8= github.com/jackc/pgx/v5 v5.2.0/go.mod h1:Ptn7zmohNsWEsdxRawMzk3gaKma2obW+NWTnKa0S4nk= github.com/jackc/puddle/v2 v2.1.2/go.mod h1:2lpufsF5mRHO6SuZkm0fNYxM6SWHfvyFj62KwNzgels= github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= -github.com/jellydator/ttlcache/v2 v2.11.1 h1:AZGME43Eh2Vv3giG6GeqeLeFXxwxn1/qHItqWZl6U64= -github.com/jellydator/ttlcache/v2 v2.11.1/go.mod h1:RtE5Snf0/57e+2cLWFYWCCsLas2Hy3c5Z4n14XmSvTI= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= @@ -257,7 +239,6 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= @@ -265,7 +246,6 @@ github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= @@ -278,7 +258,6 @@ github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjU github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= @@ -295,19 +274,9 @@ github.com/multiformats/go-varint v0.0.6 h1:gk85QWKxh3TazbLxED/NlDVv8+q+ReFJk7Y2 github.com/multiformats/go-varint v0.0.6/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/natefinch/lumberjack v2.0.0+incompatible h1:4QJd3OLAMgj7ph+yZTuX13Ld4UpgHp07nNdFX7mqFfM= github.com/natefinch/lumberjack v2.0.0+incompatible/go.mod h1:Wi9p2TTF5DG5oU+6YfsmYQpsTIOm0B1VNzQg9Mw6nPk= -github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= -github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= -github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo/v2 v2.2.0 h1:3ZNA3L1c5FYDFTTxbFeVGGD8jYvjYauHD30YgLxVsNI= github.com/onsi/ginkgo/v2 v2.2.0/go.mod h1:MEH45j8TBi6u9BMogfbp0stKC5cdGjumZj5Y7AG4VIk= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.20.1 h1:PA/3qinGoukvymdIDV8pii6tiZgC8kbmJO6Z5+b002Q= github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= github.com/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU= @@ -380,9 +349,7 @@ github.com/tklauser/go-sysconf v0.3.5/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITn github.com/tklauser/numcpus v0.2.2 h1:oyhllyrScuYI6g+h/zUvNXNp1wy7x8qQy3t/piefldA= github.com/tklauser/numcpus v0.2.2/go.mod h1:x3qojaO3uyYt0i56EW/VUYs7uBvdl2fkfZFu0T9wgjM= github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef h1:wHSqTBrZW24CsNJDfeh9Ex6Pm0Rcpc7qrgKBiL44vF4= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= github.com/ugorji/go/codec v1.2.9 h1:rmenucSohSTiyL09Y+l2OCk+FrMxGMzho2+tjr5ticU= github.com/ugorji/go/codec v1.2.9/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= @@ -408,7 +375,6 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= @@ -468,7 +434,6 @@ golang.org/x/mod v0.6.0 h1:b9gGHsz9/HhJ3HF5DHQytPpuwocVTChQJK3AvoLRD5I= golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= 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= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -489,7 +454,6 @@ golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= @@ -500,7 +464,6 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= @@ -529,9 +492,7 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220923202941-7f9b1623fab7/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -540,14 +501,10 @@ golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -565,7 +522,6 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -617,7 +573,6 @@ golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -647,10 +602,8 @@ golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82u golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210112230658-8b4aab62c064/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= @@ -749,7 +702,6 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= @@ -758,19 +710,13 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/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/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/internal/app/api/v1/account.go b/internal/app/api/v1/account.go index e8742de..3b3ac61 100644 --- a/internal/app/api/v1/account.go +++ b/internal/app/api/v1/account.go @@ -54,17 +54,27 @@ func GetCollection(c *gin.Context) { } func GetContract(c *gin.Context) { - address := strings.ToLower(c.Param("address")) + address := c.Param("address") account := c.GetString("address") - if !utils.IsValidAddress(address) { - response.FailWithMessage("Param Error", c) + if utils.IsValidSolanaAddress(address) { + response.OkWithDetailed(nil, "Success", c) return - } - if list, err := service.GetContract(address, account); err != nil { - global.LOG.Error("Error!", zap.Error(err)) - response.FailWithMessage("Error", c) + if list, err := service.GetSolanaContract(address, account); err != nil { + global.LOG.Error("Error!", zap.Error(err)) + response.FailWithMessage("Error", c) + } else { + response.OkWithDetailed(list, "Success", c) + } + } else if utils.IsValidAddress(address) { + address = strings.ToLower(address) + if list, err := service.GetContract(address, account); err != nil { + global.LOG.Error("Error!", zap.Error(err)) + response.FailWithMessage("Error", c) + } else { + response.OkWithDetailed(list, "Success", c) + } } else { - response.OkWithDetailed(list, "Success", c) + response.FailWithMessage("地址错误", c) } } diff --git a/internal/app/initialize/gorm.go b/internal/app/initialize/gorm.go index d658c5a..1400caa 100644 --- a/internal/app/initialize/gorm.go +++ b/internal/app/initialize/gorm.go @@ -25,6 +25,8 @@ func RegisterTables(db *gorm.DB) { model.Account{}, model.ContractDefault{}, model.Ens{}, + model.CollectionSolana{}, + model.ContractSolana{}, ) if err != nil { global.LOG.Error("register table failed", zap.Error(err)) diff --git a/internal/app/model/account.go b/internal/app/model/account.go index 6bfa5df..8df95a2 100644 --- a/internal/app/model/account.go +++ b/internal/app/model/account.go @@ -7,10 +7,11 @@ import ( type Account struct { global.MODEL - Address string `gorm:"type:char(42);index:account_address,unique;not null;" json:"address" form:"address"` + Address string `gorm:"type:char(44);index:account_address,unique;not null;" json:"address" form:"address"` ContractIDs pq.StringArray `gorm:"type:uuid[]" json:"contract_ids" form:"contract_ids"` // 合约ID Counts pq.Int64Array `gorm:"type:integer[]" json:"counts" form:"counts"` // 数量 CountsShow pq.Int64Array `gorm:"type:integer[]" json:"counts_show" form:"counts_show"` // 显示数量 //CountsDefault pq.Int64Array `gorm:"type:integer[]" json:"counts_default" form:"counts_default"` // 默认合约数量 - Total int `gorm:"column:total;default:0"` // NFT总数 + Total int `gorm:"column:total;default:0"` // NFT总数 + Type uint8 `gorm:"column:type;default:1"` // 类型(1:eth 2:solana) } diff --git a/internal/app/model/collection.go b/internal/app/model/collection.go index 18dea0f..e3b722a 100644 --- a/internal/app/model/collection.go +++ b/internal/app/model/collection.go @@ -7,7 +7,7 @@ import ( type Collection struct { global.MODEL Chain string `gorm:"column:chain;index:chain_address_contract_token,unique" json:"chain" form:"chain"` // 区块链的简称(eth, bnb, polygon, moonbeam, arbitrum, optimism, platon, avalanche, cronos) - AccountAddress string `gorm:"column:account_address;type:char(42);index:chain_address_contract_token,unique" json:"account_address" form:"account_address"` // 资产持有者的地址 + AccountAddress string `gorm:"column:account_address;type:char(44);index:chain_address_contract_token,unique" json:"account_address" form:"account_address"` // 资产持有者的地址 Status uint8 `gorm:"default:0;" json:"status" form:"status"` // 显示状态(0:初始状态 1:隐藏 2:显示) NFTScanOwn } @@ -15,7 +15,7 @@ type Collection struct { type CollectionUpdate struct { global.MODEL Chain string `gorm:"column:chain;index:chain_address_contract_token,unique" json:"chain" form:"chain"` // 区块链的简称(eth, bnb, polygon, moonbeam, arbitrum, optimism, platon, avalanche, cronos) - AccountAddress string `gorm:"column:account_address;type:char(42);index:chain_address_contract_token,unique" json:"account_address" form:"account_address"` // 资产持有者的地址 + AccountAddress string `gorm:"column:account_address;type:char(44);index:chain_address_contract_token,unique" json:"account_address" form:"account_address"` // 资产持有者的地址 Status uint8 `gorm:"-" json:"status" form:"status"` // 显示状态(1:隐藏 2:显示) NFTScanOwn } diff --git a/internal/app/model/collection_solana.go b/internal/app/model/collection_solana.go new file mode 100644 index 0000000..fcc1a1f --- /dev/null +++ b/internal/app/model/collection_solana.go @@ -0,0 +1,27 @@ +package model + +import ( + "nft-collect/internal/app/global" +) + +type CollectionSolana struct { + global.MODEL + Status uint8 `gorm:"default:0;" json:"status" form:"status"` // 显示状态(0:初始状态 1:隐藏 2:显示) + NFTScanSolana +} + +type NFTScanSolana struct { + Collection string `gorm:"column:collection" json:"collection" form:"collection"` // Collection 地址 + TokenAddress string `gorm:"column:token_address;unique" json:"token_address" form:"token_address"` // Token 地址 + Minter string `json:"minter" form:"minter"` + Owner string `json:"owner" form:"owner"` + MintTimestamp int64 `json:"mint_timestamp"` + MintTransactionHash string `json:"mint_transaction_hash"` + TokenURI string `json:"token_uri"` + MetadataJSON string `json:"metadata_json"` + Name string `json:"name"` + ContentType string `json:"content_type"` + ContentURI string `json:"content_uri"` + ImageURI string `json:"image_uri"` + ExternalLink string `json:"external_link"` +} diff --git a/internal/app/model/contract_solana.go b/internal/app/model/contract_solana.go new file mode 100644 index 0000000..2a5282a --- /dev/null +++ b/internal/app/model/contract_solana.go @@ -0,0 +1,18 @@ +package model + +import ( + "nft-collect/internal/app/global" +) + +type ContractSolana struct { + global.MODEL + Chain string `gorm:"default:'solana'" json:"chain" form:"chain"` // 区块链的简称 + ContractAddress string `gorm:"default:''" json:"contract_address" form:"contract_address"` // 合约地址 + ContractName string `gorm:"default:'';not null" json:"contract_name" form:"contract_name"` // 合约名称 + ContractLogo string `gorm:"default:''" json:"contract_logo" form:"contract_logo"` // 合约Logo + ContractBanner string `gorm:"default:''" json:"contract_banner" form:"contract_banner"` // 合约Banner + ContractDescription string `gorm:"default:''" json:"contract_description" form:"contract_description"` // 合约Description + ContractWebsite string `gorm:"default:''" json:"contract_website" form:"contract_website"` // 合约Website + ContractOwner string `gorm:"default:''" json:"contract_owner" form:"contract_owner"` // 合约Owner + Status uint8 `gorm:"default:1;" json:"-" form:"-"` // 显示状态(1:未获取 2:已获取) +} diff --git a/internal/app/model/receive/solana.go b/internal/app/model/receive/solana.go new file mode 100644 index 0000000..1acb572 --- /dev/null +++ b/internal/app/model/receive/solana.go @@ -0,0 +1,31 @@ +package receive + +type SolanaCollection struct { + Code int `json:"code"` + Msg interface{} `json:"msg"` + Data struct { + Total int `json:"total"` + Next interface{} `json:"next"` + Content []struct { + BlockNumber int `json:"block_number"` + InteractProgram string `json:"interact_program"` + Collection string `json:"collection"` + TokenAddress string `json:"token_address"` + Minter string `json:"minter"` + Owner string `json:"owner"` + MintTimestamp int64 `json:"mint_timestamp"` + MintTransactionHash string `json:"mint_transaction_hash"` + MintPrice int `json:"mint_price"` + TokenURI string `json:"token_uri"` + MetadataJSON string `json:"metadata_json"` + Name string `json:"name"` + ContentType string `json:"content_type"` + ContentURI string `json:"content_uri"` + ImageURI string `json:"image_uri"` + ExternalLink string `json:"external_link"` + LatestTradePrice interface{} `json:"latest_trade_price"` + LatestTradeTimestamp interface{} `json:"latest_trade_timestamp"` + LatestTradeTransactionHash interface{} `json:"latest_trade_transaction_hash"` + } `json:"content"` + } `json:"data"` +} diff --git a/internal/app/model/response/account.go b/internal/app/model/response/account.go index fec7307..479ebda 100644 --- a/internal/app/model/response/account.go +++ b/internal/app/model/response/account.go @@ -4,6 +4,11 @@ import ( "nft-collect/internal/app/model" ) +type GetSolanaContractRes struct { + model.ContractSolana + Count int64 `gorm:"-" json:"count" form:"count"` +} + type GetContractRes struct { model.Contract Count int64 `gorm:"-" json:"count" form:"count"` diff --git a/internal/app/service/account_solana.go b/internal/app/service/account_solana.go new file mode 100644 index 0000000..2782ce3 --- /dev/null +++ b/internal/app/service/account_solana.go @@ -0,0 +1,136 @@ +package service + +import ( + "gorm.io/gorm" + "nft-collect/internal/app/global" + "nft-collect/internal/app/model" + "nft-collect/internal/app/model/response" +) + +// GetSolanaContract 获取 Solana 合约 +func GetSolanaContract(address, account string) (res []response.GetSolanaContractRes, err error) { + db := global.DB + var user model.Account + + errFirst := db.Model(&model.Account{}).Where("address = ?", address).First(&user).Error + if errFirst != nil && errFirst != gorm.ErrRecordNotFound { + return res, errFirst + } + // 初始化账户 + if errFirst == gorm.ErrRecordNotFound { + initSolanaAccount(address) + if err = db.Model(&model.Account{}).Where("address = ?", address).First(&user).Error; err != nil { + return + } + } + + //if len(user.ContractIDs) != len(user.Counts) { + // updateSolanaContractCount(address) + //} + // TODO 查询默认合约 + dealList := []string{"Decert Badge"} + contractMap := make(map[string]int64) + for _, name := range dealList { + // TODO 优化 + var count int64 + err = db.Model(&model.Collection{}). + Raw("SElECT COUNT(1) FROM collection_solana a JOIN contract_solana b ON a.collection=b.contract_name WHERE b.contract_name = ? AND minter= ?", name, address). + Scan(&count).Error + contractMap[name] = count + } + // show different counts + if address == account { + for i, _ := range user.ContractIDs { + contractMap[user.ContractIDs[i]] = user.Counts[i] + } + } else { + for i, _ := range user.ContractIDs { + contractMap[user.ContractIDs[i]] = user.CountsShow[i] + } + } + // slice as query + var contractIDs []string + for _, c := range dealList { + contractIDs = append(contractIDs, c) + } + for _, c := range user.ContractIDs { + contractIDs = append(contractIDs, c) + } + // get contract detail + var contract []model.ContractSolana + err = db.Model(&model.ContractSolana{}).Where("contract_name", contractIDs).Find(&contract).Error + if err != nil { + return res, err + } + res = append(res, response.GetSolanaContractRes{ContractSolana: contract[0], Count: contractMap[contract[0].ContractName]}) + return res, err +} + +// initSolanaAccount +func initSolanaAccount(address string) (err error) { + var uuidList []string + // 创建 + var id string + db := global.DB.Model(&model.ContractSolana{}).Select("id") + errFirst := db.First(&id).Error + if errFirst != nil { + if errFirst != gorm.ErrRecordNotFound { + return errFirst + } + return errFirst + } + uuidList = append(uuidList, id) + + user := &model.Account{Address: address} + err = global.DB.Model(&model.Account{}).Create(&user).Error + if err != nil { + return err + } + //updateSolanaAllCollection(address, uuidList, true, false) + return err +} + +/* +// updateSolanaContractCount +func updateSolanaContractCount(address string) (err error) { + db := global.DB + var user model.Account + if err = db.Model(&model.Account{}).Select("contract_ids").Where("address", address).First(&user).Error; err != nil { + return err + } + var counts []int64 + var countsShow []int64 + var contractIDs []string + for _, v := range user.ContractIDs { + var nftContract model.ContractSolana + if errErrFind := db.Model(&model.ContractSolana{}).Where("id", v).First(&nftContract).Error; errErrFind != nil { + continue + } + var count int64 + var countShow int64 + + // TODO: 添加状态 需要确定是否过滤 + err = db.Model(&model.CollectionSolana{}). + Where("collection", nftContract.ContractName).Where("minter", address). + Count(&count).Error + if err != nil { + return err + } + err = db.Model(&model.CollectionSolana{}). + Where("collection", nftContract.ContractName).Where("minter", address).Where("status", 2). + Count(&countShow).Error + if err != nil { + return err + } + contractIDs = append(contractIDs, v) + counts = append(counts, count) + countsShow = append(countsShow, countShow) + } + if err = db.Model(&model.Account{}).Where("address", address).Updates(model.Account{ContractIDs: contractIDs, Counts: counts, CountsShow: countsShow}).Error; err != nil { + return err + } + + // TODO: 清除零数量的合约 + return nil +} +*/ diff --git a/internal/app/service/collection.go b/internal/app/service/collection.go index ee3d3ec..c977b67 100644 --- a/internal/app/service/collection.go +++ b/internal/app/service/collection.go @@ -257,8 +257,8 @@ func updateAllCollection(address string, uuidList []string, init bool, refresh b func addCollectionByContract(wg *sync.WaitGroup, address string, erc_type string, api config.APIConfig, contract string) (err error) { defer wg.Done() var user model.Account - contractList := make(map[common.Address]struct{}) - contractList[common.HexToAddress(contract)] = struct{}{} + contractList := make(map[string]struct{}) + contractList[contract] = struct{}{} if err = global.DB.Model(&model.Account{}).Select("contract_ids").Where("address", address).First(&user).Error; err != nil { return err } @@ -267,7 +267,7 @@ func addCollectionByContract(wg *sync.WaitGroup, address string, erc_type string if err = global.DB.Model(&model.Contract{}).Select("contract_address").Where("id", v).First(&contracts).Error; err != nil { return err } - contractList[common.HexToAddress(contracts)] = struct{}{} + contractList[contracts] = struct{}{} } assetsUrl := fmt.Sprintf("https://%s.nftscan.com/api/v2/account/own/%s?limit=300&erc_type=%s&contract_address=%s", api.APIPreHost, address, erc_type, contract) var cursor string @@ -316,7 +316,7 @@ func addCollectionByContract(wg *sync.WaitGroup, address string, erc_type string } for _, v := range nftScan { - if _, ok := contractList[common.HexToAddress(v.ContractAddress)]; !ok { + if _, ok := contractList[v.ContractAddress]; !ok { continue } nft = append(nft, model.Collection{Chain: api.Chain, AccountAddress: address, NFTScanOwn: v}) @@ -368,8 +368,8 @@ func addAllCollection(address string, api config.APIConfig, contract string) (to } }() var user model.Account - contractList := make(map[common.Address]struct{}) - contractList[common.HexToAddress(contract)] = struct{}{} + contractList := make(map[string]struct{}) + contractList[contract] = struct{}{} if err = global.DB.Model(&model.Account{}).Select("contract_ids").Where("address", address).First(&user).Error; err != nil { return total, err @@ -384,7 +384,7 @@ func addAllCollection(address string, api config.APIConfig, contract string) (to if err = global.DB.Model(&model.Contract{}).Select("contract_address").Where("id", v).First(&contracts).Error; err != nil { return total, err } - contractList[common.HexToAddress(contracts)] = struct{}{} + contractList[contracts] = struct{}{} } assetsUrl := fmt.Sprintf("https://%s.nftscan.com/api/v2/account/own/all/%s?show_attribute=false", api.APIPreHost, address) //var cursor string @@ -425,7 +425,7 @@ func addAllCollection(address string, api config.APIConfig, contract string) (to } total = len(nftScan) for _, v := range nftScan { - if _, ok := contractList[common.HexToAddress(v.ContractAddress)]; !ok { + if _, ok := contractList[v.ContractAddress]; !ok { continue } nft = append(nft, model.Collection{Chain: api.Chain, AccountAddress: address, NFTScanOwn: v, Status: 2}) diff --git a/internal/app/service/collection_solana.go b/internal/app/service/collection_solana.go new file mode 100644 index 0000000..7d68488 --- /dev/null +++ b/internal/app/service/collection_solana.go @@ -0,0 +1,79 @@ +package service + +import ( + "fmt" + "go.uber.org/zap" + "gorm.io/gorm" + "nft-collect/internal/app/global" + "nft-collect/internal/app/model" + "nft-collect/internal/app/model/request" + "nft-collect/internal/app/model/response" +) + +// updateSolanaAllCollection +func updateSolanaAllCollection(address string, uuidList []string, init bool, refresh bool) { + var err error + for _, v := range uuidList { + var contracts string + if err = global.DB.Model(&model.ContractSolana{}).Select("contract_address").Where("id", v).First(&contracts).Error; err != nil { + return + } + if err = global.DB.Model(&model.CollectionSolana{}).Where("account_address", address). + Where("contract_address", contracts). + Where("status=1"). + Updates(map[string]interface{}{"status": 2}).Error; err != nil { + return + } + } + // 更新用户展示数量 + //_ = updateSolanaContractCount(address) +} + +// GetSolanaCollection +func GetSolanaCollection(req request.GetCollectionReq, account string) (total, totalPublic, totalHidden int64, res []response.GetCollection, err error) { + limit := req.PageSize + offset := req.PageSize * (req.Page - 1) + + db := global.DB.Model(&model.CollectionSolana{}).Select("collection_solana.*,contract.contract_logo"). + Joins("left join contract ON contract.chain=collection_solana.chain AND contract.contract_address=collection.contract_address"). + Where("collection.account_address", req.AccountAddress) + if req.Search != "" { + db.Where("token_id ILIKE ? OR name ILIKE ?", "%"+req.Search+"%", "%"+req.Search+"%") + } + + if req.ContractID != "" { + var contract model.ContractSolana + if err := global.DB.Model(&model.ContractSolana{}).Where("id", req.ContractID).First(&contract).Error; err != nil { + global.LOG.Error("error first", zap.Error(err)) + return total, totalPublic, totalHidden, res, err + } + db.Where("collection_solana.collection", contract.ContractName) + } + err = db.Count(&total).Error + if err != nil { + return + } + if err = db.Session(&gorm.Session{}).Where("collection.status", 1).Count(&totalHidden).Error; err != nil { + return + } + if err = db.Session(&gorm.Session{}).Where("collection.status", 2).Count(&totalPublic).Error; err != nil { + return + } + + if req.Status != 0 { + db.Where("collection.status", req.Status) + } else if req.AccountAddress != account { + db.Where("collection.status", 2) + } + + if req.Sort != "asc" && req.Sort != "desc" { + req.Sort = "desc" + } + orderBy := fmt.Sprintf("own_timestamp %s", req.Sort) + err = db.Limit(limit).Offset(offset).Order(orderBy).Find(&res).Error + if err != nil { + return total, totalPublic, totalHidden, res, err + } + + return +} diff --git a/internal/app/service/service.go b/internal/app/service/service.go new file mode 100644 index 0000000..1b0ed86 --- /dev/null +++ b/internal/app/service/service.go @@ -0,0 +1,5 @@ +package service + +func Service() { + SolanaGet() +} diff --git a/internal/app/service/solana.go b/internal/app/service/solana.go new file mode 100644 index 0000000..786e310 --- /dev/null +++ b/internal/app/service/solana.go @@ -0,0 +1,68 @@ +package service + +import ( + "encoding/json" + "fmt" + "github.com/imroc/req/v3" + "github.com/tidwall/gjson" + "gorm.io/gorm/clause" + "nft-collect/internal/app/global" + "nft-collect/internal/app/model" + "time" +) + +func SolanaGet() (err error) { + assetsUrl := fmt.Sprintf("https://solanaapi.nftscan.com/api/sol/assets/collection/Decert Badge?show_attribute=false") + var cursor string + var nft []model.CollectionSolana + var errFlag bool + client := req.C().SetTimeout(120*time.Second). + SetCommonRetryCount(1). + SetUserAgent("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36"). + SetCommonHeader("X-API-KEY", global.CONFIG.NFT.ApiKey) + i := 0 + for { + i++ + reqUrl := assetsUrl + fmt.Sprintf("&cursor=%s", cursor) + req, errReq := client.R().Get(reqUrl) + if errReq != nil { + fmt.Println(errReq) + errFlag = true + break + } + res := req.String() + if gjson.Get(res, "data.total").Uint() == 0 { + fmt.Println("No data") + break + } + if gjson.Get(res, "code").String() != "200" { + errFlag = true + break + } + var nftScan []model.NFTScanSolana + if errParse := json.Unmarshal([]byte(gjson.Get(res, "data.content").String()), &nftScan); errParse != nil { + fmt.Println(errParse) + errFlag = true + break + } + for _, v := range nftScan { + nft = append(nft, model.CollectionSolana{NFTScanSolana: v}) + } + cursor = gjson.Get(res, "data.next").String() + if cursor == "" { + break + } + } + if len(nft) == 0 { + return nil + } + // 保存数据 + if err = global.DB.Model(&model.CollectionSolana{}).Omit("status").Clauses(clause.OnConflict{ + Columns: []clause.Column{{Name: "token_address"}}, + UpdateAll: true, + }).Create(&nft).Error; err != nil { + return err + } + _ = errFlag + return nil +} diff --git a/internal/app/service/solana_test.go b/internal/app/service/solana_test.go new file mode 100644 index 0000000..7552f73 --- /dev/null +++ b/internal/app/service/solana_test.go @@ -0,0 +1,57 @@ +package service + +import ( + "encoding/json" + "fmt" + "github.com/imroc/req/v3" + "github.com/tidwall/gjson" + "nft-collect/internal/app/model" + "testing" + "time" +) + +func TestSolanaGet(t *testing.T) { + assetsUrl := fmt.Sprintf("https://solanaapi.nftscan.com/api/sol/assets/collection/Decert Badge?show_attribute=false") + var cursor string + var nft []model.CollectionSolana + var errFlag bool + client := req.C().SetTimeout(120*time.Second). + SetCommonRetryCount(1). + SetUserAgent("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36"). + SetCommonHeader("X-API-KEY", "2UEM6Uto") + i := 0 + for { + i++ + reqUrl := assetsUrl + fmt.Sprintf("&cursor=%s", cursor) + req, errReq := client.R().Get(reqUrl) + if errReq != nil { + fmt.Println(errReq) + errFlag = true + break + } + res := req.String() + if gjson.Get(res, "data.total").Uint() == 0 { + fmt.Println("No data") + break + } + if gjson.Get(res, "code").String() != "200" { + errFlag = true + break + } + var nftScan []model.NFTScanSolana + if errParse := json.Unmarshal([]byte(gjson.Get(res, "data.content").String()), &nftScan); errParse != nil { + fmt.Println(errParse) + errFlag = true + break + } + for _, v := range nftScan { + nft = append(nft, model.CollectionSolana{NFTScanSolana: v}) + } + cursor = gjson.Get(res, "data.next").String() + if cursor == "" { + break + } + } + fmt.Println(errFlag) + fmt.Println("nft", nft) +} diff --git a/internal/app/utils/utils.go b/internal/app/utils/utils.go index fc7fc2c..9c125ab 100644 --- a/internal/app/utils/utils.go +++ b/internal/app/utils/utils.go @@ -2,6 +2,7 @@ package utils import ( "encoding/json" + socommon "github.com/blocto/solana-go-sdk/common" "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" @@ -84,6 +85,10 @@ func IsValidAddress(iaddress interface{}) bool { } } +func IsValidSolanaAddress(address string) bool { + return socommon.IsOnCurve(socommon.PublicKeyFromString(address)) +} + // VerifySig 校验签名 func VerifySig(from, sigHex string, msg []byte) bool { defer func() { diff --git a/main.go b/main.go index 183e500..9afd4f0 100644 --- a/main.go +++ b/main.go @@ -20,6 +20,5 @@ func main() { initialize.InitNFTContract() // 初始化链名称 initialize.InitChainName() - core.RunWindowsServer() }