From 088b4be12ab390c1de0e1718d5c32f2bf2541615 Mon Sep 17 00:00:00 2001 From: Dylan Jeffers Date: Thu, 18 Aug 2022 10:57:11 -0700 Subject: [PATCH 1/3] tmp --- creator-node/package-lock.json | 104 ++--- creator-node/package.json | 2 +- identity-service/package-lock.json | 362 ++++++++---------- identity-service/package.json | 2 +- libs/package-lock.json | 137 +++---- libs/package.json | 3 +- libs/src/NativeAudiusLibs.ts | 76 +--- libs/src/services/solana/SolanaWeb3Manager.ts | 12 +- libs/src/services/wormhole/Wormhole.ts | 8 +- service-commands/package-lock.json | 167 +++----- service-commands/package.json | 2 +- 11 files changed, 329 insertions(+), 546 deletions(-) diff --git a/creator-node/package-lock.json b/creator-node/package-lock.json index a8e123c4ebe..9a023ef3b6d 100644 --- a/creator-node/package-lock.json +++ b/creator-node/package-lock.json @@ -2259,7 +2259,7 @@ "@protobufjs/aspromise": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" }, "@protobufjs/base64": { "version": "1.1.2", @@ -2274,12 +2274,12 @@ "@protobufjs/eventemitter": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=" + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" }, "@protobufjs/fetch": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", "requires": { "@protobufjs/aspromise": "^1.1.1", "@protobufjs/inquire": "^1.1.0" @@ -2288,27 +2288,27 @@ "@protobufjs/float": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=" + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" }, "@protobufjs/inquire": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" }, "@protobufjs/path": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=" + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" }, "@protobufjs/pool": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=" + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" }, "@protobufjs/utf8": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" }, "@sindresorhus/is": { "version": "0.14.0", @@ -2360,9 +2360,9 @@ "dev": true }, "@solana/buffer-layout": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@solana/buffer-layout/-/buffer-layout-4.0.0.tgz", - "integrity": "sha512-lR0EMP2HC3+Mxwd4YcnZb0smnaDw7Bl2IQWZiTevRH5ZZBZn6VRWn3/92E3qdU4SSImJkA6IDHawOHAnx/qUvQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@solana/buffer-layout/-/buffer-layout-3.0.0.tgz", + "integrity": "sha512-MVdgAKKL39tEs0l8je0hKaXLQFb7Rdfb0Xg2LjFZd8Lfdazkg6xiS98uAZrEKvaoF3i4M95ei9RydkGIDMeo3w==", "requires": { "buffer": "~6.0.3" }, @@ -2408,43 +2408,30 @@ } }, "@solana/web3.js": { - "version": "1.53.0", - "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.53.0.tgz", - "integrity": "sha512-QyQDA9U5b+AiTo1ANsj9WihWWECeLv6VRpiTE7xPe5hLYANXZYecnlLglNiEzVgRg/jLvR5DrCISXhHx/mAEJw==", + "version": "1.31.0", + "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.31.0.tgz", + "integrity": "sha512-7nHHx1JNFnrt15e9y8m38I/EJCbaB+bFC3KZVM1+QhybCikFxGMtGA5r7PDC3GEL1R2RZA8yKoLkDKo3vzzqnw==", "requires": { "@babel/runtime": "^7.12.5", "@ethersproject/sha2": "^5.5.0", - "@solana/buffer-layout": "^4.0.0", - "bigint-buffer": "^1.1.5", + "@solana/buffer-layout": "^3.0.0", "bn.js": "^5.0.0", - "borsh": "^0.7.0", + "borsh": "^0.4.0", "bs58": "^4.0.1", "buffer": "6.0.1", - "fast-stable-stringify": "^1.0.0", + "cross-fetch": "^3.1.4", "jayson": "^3.4.4", "js-sha3": "^0.8.0", - "node-fetch": "2", - "react-native-url-polyfill": "^1.3.0", - "rpc-websockets": "^7.5.0", + "rpc-websockets": "^7.4.2", "secp256k1": "^4.0.2", "superstruct": "^0.14.2", - "tweetnacl": "^1.0.3" + "tweetnacl": "^1.0.0" }, "dependencies": { "bn.js": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", - "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" - }, - "borsh": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/borsh/-/borsh-0.7.0.tgz", - "integrity": "sha512-CLCsZGIBCFnPtkNnieW/a8wmreDmfUtjU2m9yHrzPXIlNbqVs0AQrSatSG6vdNYUqdc83tkQi2eHfF98ubzQLA==", - "requires": { - "bn.js": "^5.2.0", - "bs58": "^4.0.0", - "text-encoding-utf-8": "^1.0.2" - } + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", + "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" }, "buffer": { "version": "6.0.1", @@ -2459,29 +2446,6 @@ "version": "0.8.0", "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==" - }, - "rpc-websockets": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-7.5.0.tgz", - "integrity": "sha512-9tIRi1uZGy7YmDjErf1Ax3wtqdSSLIlnmL5OtOzgd5eqPKbsPpwDP5whUDO2LQay3Xp0CcHlcNSGzacNRluBaQ==", - "requires": { - "@babel/runtime": "^7.17.2", - "bufferutil": "^4.0.1", - "eventemitter3": "^4.0.7", - "utf-8-validate": "^5.0.2", - "uuid": "^8.3.2", - "ws": "^8.5.0" - } - }, - "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" - }, - "ws": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.8.1.tgz", - "integrity": "sha512-bGy2JzvzkPowEJV++hF07hAD6niYSr0JzBNo/J29WsB57A2r7Wlc1UFcTR9IzrPvuNVO4B8LGqF8qcpsVOhJCA==" } } }, @@ -3258,7 +3222,7 @@ "strict-uri-encode": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz", - "integrity": "sha1-ucczDHBChi9rFC3CdLvMWGbONUY=" + "integrity": "sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ==" } } }, @@ -3882,7 +3846,7 @@ "babel-plugin-syntax-jsx": { "version": "6.18.0", "resolved": "https://registry.npmjs.org/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz", - "integrity": "sha1-CvMqmm4Tyno/1QaeYtew9Y0NiUY=" + "integrity": "sha512-qrPaCSo9c8RHNRHIotaufGbuOBN8rtdC4QrrFFc43vyWCCz7Kl7GL1PGaXtMGQZUXrkCjNEgxDfmAuAabr/rlw==" }, "balanced-match": { "version": "1.0.2", @@ -4081,7 +4045,7 @@ "bmp-js": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/bmp-js/-/bmp-js-0.1.0.tgz", - "integrity": "sha1-4Fpj95amwf8l9Hcex62twUjAcjM=" + "integrity": "sha512-vHdS19CnY3hwiNdkaqk93DvjVLfbEcI8mys4UjuWrlX1haDmroo8o4xCzh4wD6DGV6HxRCyauwhHRqMTfERtjw==" }, "bn.js": { "version": "4.12.0", @@ -4339,7 +4303,7 @@ "buffer-equal": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-0.0.1.tgz", - "integrity": "sha1-kbx0sR6kBbyRa8aqkI+q+ltKrEs=" + "integrity": "sha512-RgSV6InVQ9ODPdLWJ5UAqBqJBOg370Nz6ZQtRzpt6nUjc8v0St97uJ4PYC6NztqIScrAXafKM3mZPMygSe1ggA==" }, "buffer-layout": { "version": "1.2.2", @@ -4610,7 +4574,7 @@ "camelize": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.0.tgz", - "integrity": "sha1-FkpUg+Yw+kMh5a8HAg5TGDGyYJs=" + "integrity": "sha512-W2lPwkBkMZwFlPCXhIlYgxu+7gC/NUlCtdK652DAJ1JdgV0sTrvuPFshNPrFa1TY2JOkLhgdeEBplB4ezEa+xg==" }, "caniuse-lite": { "version": "1.0.30001241", @@ -5305,7 +5269,7 @@ "css-color-keywords": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/css-color-keywords/-/css-color-keywords-1.0.0.tgz", - "integrity": "sha1-/qJhbcZ2spYmhrOvjb2+GAskTgU=" + "integrity": "sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==" }, "css-to-react-native": { "version": "3.0.0", @@ -7254,7 +7218,7 @@ "fast-stable-stringify": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fast-stable-stringify/-/fast-stable-stringify-1.0.0.tgz", - "integrity": "sha1-XFVDRisiru79NtBbNOUceMuG0xM=" + "integrity": "sha512-wpYMUmFu5f00Sm0cj2pfivpmawLZ0NKdviQ4w9zJeR8JVtOpOxHmLaJuj0vxvGqMJQWyP/COUkF75/57OKyRag==" }, "fastq": { "version": "1.13.0", @@ -11646,7 +11610,7 @@ "qr.js": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/qr.js/-/qr.js-0.0.0.tgz", - "integrity": "sha1-ys6GOG9ZoNuAUPqQ2baw6IoeNk8=" + "integrity": "sha512-c4iYnWb+k2E+vYpRimHqSu575b1/wKl4XFeJGpFmrJQz5I88v9aY2czh7s0w36srfCM1sXgC/xpoJz5dJfq+OQ==" }, "qrcode.react": { "version": "1.0.1", @@ -12820,7 +12784,7 @@ "slide": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", - "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=" + "integrity": "sha512-NwrtjCg+lZoqhFU8fOwl4ay2ei8PaqCBOUV3/ektPY9trO1yQ1oXEfmHAhKArUVUr/hOHvy5f6AdP17dCM0zMw==" }, "snake-case": { "version": "3.0.4", @@ -15203,7 +15167,7 @@ "wif": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/wif/-/wif-2.0.6.tgz", - "integrity": "sha1-CNP1IFbGZnkplyb63g1DKudLRwQ=", + "integrity": "sha512-HIanZn1zmduSF+BQhkE+YXIbEiH0xPr1012QbFEGB0xsKqJii0/SqJjyn8dFv6y36kOznMgMB+LGcbZTJ1xACQ==", "requires": { "bs58check": "<3.0.0" } @@ -15319,7 +15283,7 @@ "write-file-atomic": { "version": "1.3.4", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz", - "integrity": "sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8=", + "integrity": "sha512-SdrHoC/yVBPpV0Xq/mUZQIpW2sWXAShb/V4pomcJXh92RuaO+f3UTWItiR3Px+pLnV2PvC2/bfn5cwr5X6Vfxw==", "requires": { "graceful-fs": "^4.1.11", "imurmurhash": "^0.1.4", @@ -15400,7 +15364,7 @@ "xmlhttprequest": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz", - "integrity": "sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw=" + "integrity": "sha512-58Im/U0mlVBLM38NdZjHyhuMtCqa61469k2YP/AaPbvCoV9aQGUpbJBj1QRm2ytRiVQBD/fsw7L2bJGDVQswBA==" }, "xtend": { "version": "4.0.2", diff --git a/creator-node/package.json b/creator-node/package.json index 7133c5c04b5..0c22fb96e75 100644 --- a/creator-node/package.json +++ b/creator-node/package.json @@ -22,7 +22,7 @@ "dependencies": { "@audius/sdk": "0.0.15", "@bull-board/express": "4.0.1", - "@solana/web3.js": "1.53.0", + "@solana/web3.js": "1.31.0", "JSONStream": "^1.3.5", "async-retry": "^1.3.3", "axios": "^0.19.2", diff --git a/identity-service/package-lock.json b/identity-service/package-lock.json index 2b62383d538..9405abeffba 100644 --- a/identity-service/package-lock.json +++ b/identity-service/package-lock.json @@ -4,6 +4,16 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "101": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/101/-/101-1.6.3.tgz", + "integrity": "sha512-4dmQ45yY0Dx24Qxp+zAsNLlMF6tteCyfVzgbulvSyC7tCyd3V8sW76sS0tHq8NpcbXfWTKasfyfzU1Kd86oKzw==", + "requires": { + "clone": "^1.0.2", + "deep-eql": "^0.1.3", + "keypather": "^1.10.2" + } + }, "@amplitude/identify": { "version": "1.9.2", "resolved": "https://registry.npmjs.org/@amplitude/identify/-/identify-1.9.2.tgz", @@ -196,39 +206,6 @@ "regenerator-runtime": "^0.13.4" } }, - "@solana/web3.js": { - "version": "1.37.1", - "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.37.1.tgz", - "integrity": "sha512-1zm1blRU6ANb8bOfONibKkNKoMyzE1e0Z88MagyRLF1AmfHc+18lFvqxSQKUdazLMHcioZ28h+GfyAaeCT63iA==", - "requires": { - "@babel/runtime": "^7.12.5", - "@ethersproject/sha2": "^5.5.0", - "@solana/buffer-layout": "^4.0.0", - "bn.js": "^5.0.0", - "borsh": "^0.7.0", - "bs58": "^4.0.1", - "buffer": "6.0.1", - "cross-fetch": "^3.1.4", - "jayson": "^3.4.4", - "js-sha3": "^0.8.0", - "rpc-websockets": "^7.4.2", - "secp256k1": "^4.0.2", - "superstruct": "^0.14.2", - "tweetnacl": "^1.0.0" - }, - "dependencies": { - "borsh": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/borsh/-/borsh-0.7.0.tgz", - "integrity": "sha512-CLCsZGIBCFnPtkNnieW/a8wmreDmfUtjU2m9yHrzPXIlNbqVs0AQrSatSG6vdNYUqdc83tkQi2eHfF98ubzQLA==", - "requires": { - "bn.js": "^5.2.0", - "bs58": "^4.0.0", - "text-encoding-utf-8": "^1.0.2" - } - } - } - }, "ajv": { "version": "6.12.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz", @@ -256,15 +233,6 @@ "text-encoding-utf-8": "^1.0.2" } }, - "buffer": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.1.tgz", - "integrity": "sha512-rVAXBwEcEoYtxnHSO5iWyhzV/O1WMtkUYWlfdLS7FjU4PnSJJHEfHXi/uHPI5EwltmOA794gN3bm3/pzuctWjQ==", - "requires": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, "eth-lib": { "version": "0.2.8", "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.8.tgz", @@ -354,11 +322,6 @@ "resolved": "https://registry.npmjs.org/hashids/-/hashids-2.2.10.tgz", "integrity": "sha512-nXnYums7F8B5Y+GSThutLPlKMaamW1yjWNZVt0WModiJfdjaDZHnhYTWblS+h1OoBx3yjwiBwxldPP3nIbFSSA==" }, - "js-sha3": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", - "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==" - }, "uuid": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", @@ -2733,7 +2696,7 @@ "aes-js": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", - "integrity": "sha1-4h3xCtbCBTKVvLuNq0Cwnb6ofk0=" + "integrity": "sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==" }, "bn.js": { "version": "5.2.1", @@ -4108,25 +4071,6 @@ "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", "dev": true }, - "@solana/buffer-layout": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@solana/buffer-layout/-/buffer-layout-4.0.0.tgz", - "integrity": "sha512-lR0EMP2HC3+Mxwd4YcnZb0smnaDw7Bl2IQWZiTevRH5ZZBZn6VRWn3/92E3qdU4SSImJkA6IDHawOHAnx/qUvQ==", - "requires": { - "buffer": "~6.0.3" - }, - "dependencies": { - "buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "requires": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - } - } - }, "@solana/spl-token": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/@solana/spl-token/-/spl-token-0.1.6.tgz", @@ -4157,33 +4101,49 @@ } }, "@solana/web3.js": { - "version": "1.53.0", - "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.53.0.tgz", - "integrity": "sha512-QyQDA9U5b+AiTo1ANsj9WihWWECeLv6VRpiTE7xPe5hLYANXZYecnlLglNiEzVgRg/jLvR5DrCISXhHx/mAEJw==", + "version": "1.37.1", + "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.37.1.tgz", + "integrity": "sha512-1zm1blRU6ANb8bOfONibKkNKoMyzE1e0Z88MagyRLF1AmfHc+18lFvqxSQKUdazLMHcioZ28h+GfyAaeCT63iA==", "requires": { "@babel/runtime": "^7.12.5", "@ethersproject/sha2": "^5.5.0", "@solana/buffer-layout": "^4.0.0", - "bigint-buffer": "^1.1.5", "bn.js": "^5.0.0", "borsh": "^0.7.0", "bs58": "^4.0.1", "buffer": "6.0.1", - "fast-stable-stringify": "^1.0.0", + "cross-fetch": "^3.1.4", "jayson": "^3.4.4", "js-sha3": "^0.8.0", - "node-fetch": "2", - "react-native-url-polyfill": "^1.3.0", - "rpc-websockets": "^7.5.0", + "rpc-websockets": "^7.4.2", "secp256k1": "^4.0.2", "superstruct": "^0.14.2", - "tweetnacl": "^1.0.3" + "tweetnacl": "^1.0.0" }, "dependencies": { + "@solana/buffer-layout": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@solana/buffer-layout/-/buffer-layout-4.0.0.tgz", + "integrity": "sha512-lR0EMP2HC3+Mxwd4YcnZb0smnaDw7Bl2IQWZiTevRH5ZZBZn6VRWn3/92E3qdU4SSImJkA6IDHawOHAnx/qUvQ==", + "requires": { + "buffer": "~6.0.3" + }, + "dependencies": { + "buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + } + } + }, "bn.js": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", - "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", + "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" }, "borsh": { "version": "0.7.0", @@ -4484,18 +4444,33 @@ } }, "@types/connect": { - "version": "3.4.35", - "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", - "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", + "version": "3.4.34", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.34.tgz", + "integrity": "sha512-ePPA/JuI+X0vb+gSWlPKOY0NdNAie/rPUqX2GUPpbZwiKTkSPhjXWuee47E4MtE54QVzGCQMQkAL6JhV2E1+cQ==", "requires": { "@types/node": "*" } }, + "@types/express-serve-static-core": { + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.19.tgz", + "integrity": "sha512-DJOSHzX7pCiSElWaGR8kCprwibCB/3yW6vcT8VG3P0SJjnv19gnWG/AZMfM60Xj/YJIp/YCaDHyvzsFVeniARA==", + "requires": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*" + } + }, "@types/geojson": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-1.0.6.tgz", "integrity": "sha512-Xqg/lIZMrUd0VRmSRbCAewtwGZiAk3mEUDvV4op1tGl+LvyPcb/MIOSxTl9z+9+J+R4/vpjiCAT4xeKzH9ji1w==" }, + "@types/lodash": { + "version": "4.14.169", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.169.tgz", + "integrity": "sha512-DvmZHoHTFJ8zhVYwCLWbQ7uAbYQEk52Ev2/ZiQ7Y7gQGeV9pjBqjnQpECMHfKS1rCYAhMI7LHVxwyZLZinJgdw==" + }, "@types/long": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.1.tgz", @@ -4514,6 +4489,16 @@ "@types/node": "*" } }, + "@types/qs": { + "version": "6.9.6", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.6.tgz", + "integrity": "sha512-0/HnwIfW4ki2D8L8c9GVcG5I72s9jP5GSLVF0VIXDW00kmIpA6O33G7a8n59Tmh7Nz0WUC3rSb7PTY/sdW2JzA==" + }, + "@types/range-parser": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.3.tgz", + "integrity": "sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA==" + }, "@types/secp256k1": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.1.tgz", @@ -4522,14 +4507,6 @@ "@types/node": "*" } }, - "@types/ws": { - "version": "7.4.7", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", - "integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==", - "requires": { - "@types/node": "*" - } - }, "@walletconnect/browser-utils": { "version": "1.7.5", "resolved": "https://registry.npmjs.org/@walletconnect/browser-utils/-/browser-utils-1.7.5.tgz", @@ -4944,6 +4921,29 @@ "safer-buffer": "^2.1.0" } }, + "assert-args": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/assert-args/-/assert-args-1.2.1.tgz", + "integrity": "sha1-QEEDoUUqMv53iYgR5U5ZCoqTc70=", + "requires": { + "101": "^1.2.0", + "compound-subject": "0.0.1", + "debug": "^2.2.0", + "get-prototype-of": "0.0.0", + "is-capitalized": "^1.0.0", + "is-class": "0.0.4" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + } + } + }, "assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", @@ -5438,14 +5438,6 @@ "resolved": "https://registry.npmjs.org/bech32/-/bech32-2.0.0.tgz", "integrity": "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==" }, - "bigint-buffer": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/bigint-buffer/-/bigint-buffer-1.1.5.tgz", - "integrity": "sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA==", - "requires": { - "bindings": "^1.3.0" - } - }, "bignumber.js": { "version": "9.0.2", "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.2.tgz", @@ -6201,6 +6193,11 @@ "safe-buffer": "^5.0.1" } }, + "circular-json": { + "version": "0.5.9", + "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.5.9.tgz", + "integrity": "sha512-4ivwqHpIFJZBuhN3g/pEcdbnGUywkBblloGbkglyloVjjR3uT6tieI89MVOfbP2tHX5sgb01FuLgAOzebNlJNQ==" + }, "class-is": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/class-is/-/class-is-1.1.0.tgz", @@ -6409,6 +6406,11 @@ "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", "dev": true }, + "compound-subject": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/compound-subject/-/compound-subject-0.0.1.tgz", + "integrity": "sha1-JxVUaYoVrmCLHfyv0wt7oeqJLEs=" + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -6704,21 +6706,11 @@ } }, "cross-fetch": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz", - "integrity": "sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==", + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.4.tgz", + "integrity": "sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ==", "requires": { - "node-fetch": "2.6.7" - }, - "dependencies": { - "node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "requires": { - "whatwg-url": "^5.0.0" - } - } + "node-fetch": "2.6.1" } }, "cross-spawn": { @@ -6863,6 +6855,14 @@ "mimic-response": "^1.0.0" } }, + "deep-eql": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-0.1.3.tgz", + "integrity": "sha1-71WKyrjeJSBs1xOQbXTlaTDrafI=", + "requires": { + "type-detect": "0.1.1" + } + }, "deep-extend": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", @@ -6991,11 +6991,6 @@ } } }, - "delay": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/delay/-/delay-5.0.0.tgz", - "integrity": "sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw==" - }, "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -8485,7 +8480,7 @@ "eyes": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", - "integrity": "sha512-GipyPsXO1anza0AOZdy69Im7hGFCNB7Y/NGjDlZGJ3GJJLtwNSb2vrzYrTYJRrRloVx7pl+bhUaTB8yiccPvFQ==" + "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=" }, "fast-deep-equal": { "version": "3.1.3", @@ -8502,11 +8497,6 @@ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" }, - "fast-stable-stringify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fast-stable-stringify/-/fast-stable-stringify-1.0.0.tgz", - "integrity": "sha512-wpYMUmFu5f00Sm0cj2pfivpmawLZ0NKdviQ4w9zJeR8JVtOpOxHmLaJuj0vxvGqMJQWyP/COUkF75/57OKyRag==" - }, "figures": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", @@ -8909,6 +8899,11 @@ "resolved": "https://registry.npmjs.org/get-port/-/get-port-5.1.1.tgz", "integrity": "sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ==" }, + "get-prototype-of": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/get-prototype-of/-/get-prototype-of-0.0.0.tgz", + "integrity": "sha1-mHcr0QcW0W3rSzIlFsRp78oorEQ=" + }, "get-stdin": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", @@ -9618,6 +9613,11 @@ "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.3.tgz", "integrity": "sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==" }, + "is-capitalized": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-capitalized/-/is-capitalized-1.0.0.tgz", + "integrity": "sha1-TIRktNkdPk7rRIid0s2PGwrEwTY=" + }, "is-ci": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.2.1.tgz", @@ -9627,6 +9627,11 @@ "ci-info": "^1.5.0" } }, + "is-class": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/is-class/-/is-class-0.0.4.tgz", + "integrity": "sha1-4FdFFwW7NOOePjNZjJOpg3KWtzY=" + }, "is-core-module": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", @@ -9901,11 +9906,6 @@ "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", "dev": true }, - "isomorphic-ws": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", - "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==" - }, "isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", @@ -10122,39 +10122,27 @@ } }, "jayson": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/jayson/-/jayson-3.7.0.tgz", - "integrity": "sha512-tfy39KJMrrXJ+mFcMpxwBvFDetS8LAID93+rycFglIQM4kl3uNR3W4lBLE/FFhsoUCEox5Dt2adVpDm/XtebbQ==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/jayson/-/jayson-3.6.2.tgz", + "integrity": "sha512-hbl+x2xH6FT7nckw+Pq3lKOIJaMBKOgNJEVfvloDBWB8iSfzn/1U2igj1A5rplqNMFN/OnnaTNw8qPKVmoq83Q==", "requires": { "@types/connect": "^3.4.33", + "@types/express-serve-static-core": "^4.17.9", + "@types/lodash": "^4.14.159", "@types/node": "^12.12.54", - "@types/ws": "^7.4.4", "JSONStream": "^1.3.5", "commander": "^2.20.3", - "delay": "^5.0.0", "es6-promisify": "^5.0.0", "eyes": "^0.1.8", - "isomorphic-ws": "^4.0.1", "json-stringify-safe": "^5.0.1", "lodash": "^4.17.20", - "uuid": "^8.3.2", - "ws": "^7.4.5" + "uuid": "^3.4.0" }, "dependencies": { "@types/node": { - "version": "12.20.55", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", - "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==" - }, - "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" - }, - "ws": { - "version": "7.5.9", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", - "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==" + "version": "12.20.13", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.13.tgz", + "integrity": "sha512-1x8W5OpxPq+T85OUsHRP6BqXeosKmeXRtjoF39STcdf/UWLqUsoehstZKOi0CunhVqHG17AyZgpj20eRVooK6A==" } } }, @@ -10305,7 +10293,7 @@ "jsonparse": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", - "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==" + "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=" }, "jsonschema": { "version": "1.2.6", @@ -10449,6 +10437,14 @@ "keccak": "^3.0.1" } }, + "keypather": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/keypather/-/keypather-1.10.2.tgz", + "integrity": "sha1-4ESWMtSz5RbyHMAUznxWRP3c5hQ=", + "requires": { + "101": "^1.0.0" + } + }, "keyv": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", @@ -12628,14 +12624,6 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, - "react-native-url-polyfill": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/react-native-url-polyfill/-/react-native-url-polyfill-1.3.0.tgz", - "integrity": "sha512-w9JfSkvpqqlix9UjDvJjm1EjSt652zVQ6iwCIj1cVVkwXf4jQhQgTNXY6EVTwuAmUjg6BC6k9RHCBynoLFo3IQ==", - "requires": { - "whatwg-url-without-unicode": "8.0.0-3" - } - }, "read-pkg": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", @@ -13041,7 +13029,7 @@ "retry": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", - "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=" + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==" }, "retry-as-promised": { "version": "2.3.2", @@ -13108,26 +13096,20 @@ "integrity": "sha512-rZqFD43y4U9nSqVq3iyWBiDwmBQJY8Txi04yI9jTKD3xcl7CbFjh1qRpQshUB3sONLubDzm7vJiwB+1MEGv67w==" }, "rpc-websockets": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-7.5.0.tgz", - "integrity": "sha512-9tIRi1uZGy7YmDjErf1Ax3wtqdSSLIlnmL5OtOzgd5eqPKbsPpwDP5whUDO2LQay3Xp0CcHlcNSGzacNRluBaQ==", + "version": "7.4.12", + "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-7.4.12.tgz", + "integrity": "sha512-WxZRM4443SiYbJhsLwVJc6P/VAQJIkeDS89CQAuHqyMt/GX8GEplWZezcLw6MMGemzA6Kp32kz7CbQppMTLQxA==", "requires": { - "@babel/runtime": "^7.17.2", + "@babel/runtime": "^7.11.2", + "assert-args": "^1.2.1", "bufferutil": "^4.0.1", + "circular-json": "^0.5.9", "eventemitter3": "^4.0.7", "utf-8-validate": "^5.0.2", - "uuid": "^8.3.2", - "ws": "^8.5.0" + "uuid": "^8.3.0", + "ws": "^7.4.5" }, "dependencies": { - "@babel/runtime": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.18.9.tgz", - "integrity": "sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw==", - "requires": { - "regenerator-runtime": "^0.13.4" - } - }, "eventemitter3": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", @@ -13139,9 +13121,9 @@ "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" }, "ws": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.8.1.tgz", - "integrity": "sha512-bGy2JzvzkPowEJV++hF07hAD6niYSr0JzBNo/J29WsB57A2r7Wlc1UFcTR9IzrPvuNVO4B8LGqF8qcpsVOhJCA==" + "version": "7.4.5", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.5.tgz", + "integrity": "sha512-xzyu3hFvomRfXKH8vOFMU3OguG6oOvhXMo3xsGy3xWExqaM2dxBbVxuD99O7m3ZUFMvvscsZDqxfgMaRr/Nr1g==" } } }, @@ -13623,7 +13605,7 @@ "slide": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", - "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=" + "integrity": "sha512-NwrtjCg+lZoqhFU8fOwl4ay2ei8PaqCBOUV3/ektPY9trO1yQ1oXEfmHAhKArUVUr/hOHvy5f6AdP17dCM0zMw==" }, "smart-buffer": { "version": "4.1.0", @@ -14545,6 +14527,11 @@ "prelude-ls": "~1.1.2" } }, + "type-detect": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-0.1.1.tgz", + "integrity": "sha1-C6XsKohWQORw6k6FBZcZANrFiCI=" + }, "type-fest": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", @@ -15357,23 +15344,6 @@ "webidl-conversions": "^3.0.0" } }, - "whatwg-url-without-unicode": { - "version": "8.0.0-3", - "resolved": "https://registry.npmjs.org/whatwg-url-without-unicode/-/whatwg-url-without-unicode-8.0.0-3.tgz", - "integrity": "sha512-HoKuzZrUlgpz35YO27XgD28uh/WJH4B0+3ttFqRo//lmq+9T/mIOJ6kqmINI9HpUpz1imRC/nR/lxKpJiv0uig==", - "requires": { - "buffer": "^5.4.3", - "punycode": "^2.1.1", - "webidl-conversions": "^5.0.0" - }, - "dependencies": { - "webidl-conversions": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz", - "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==" - } - } - }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", @@ -15552,7 +15522,7 @@ "write-file-atomic": { "version": "1.3.4", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz", - "integrity": "sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8=", + "integrity": "sha512-SdrHoC/yVBPpV0Xq/mUZQIpW2sWXAShb/V4pomcJXh92RuaO+f3UTWItiR3Px+pLnV2PvC2/bfn5cwr5X6Vfxw==", "requires": { "graceful-fs": "^4.1.11", "imurmurhash": "^0.1.4", @@ -15640,7 +15610,7 @@ "xmlhttprequest": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz", - "integrity": "sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw=" + "integrity": "sha512-58Im/U0mlVBLM38NdZjHyhuMtCqa61469k2YP/AaPbvCoV9aQGUpbJBj1QRm2ytRiVQBD/fsw7L2bJGDVQswBA==" }, "xregexp": { "version": "2.0.0", diff --git a/identity-service/package.json b/identity-service/package.json index a0b73d45666..95ce9ec3ebd 100644 --- a/identity-service/package.json +++ b/identity-service/package.json @@ -24,7 +24,7 @@ "@optimizely/optimizely-sdk": "^4.6.0", "@sentry/node": "^6.2.5", "@sentry/tracing": "^6.2.5", - "@solana/web3.js": "1.53.0", + "@solana/web3.js": "1.37.1", "apn": "^2.2.0", "aws-sdk": "^2.595.0", "axios": "^0.19.0", diff --git a/libs/package-lock.json b/libs/package-lock.json index 117edd69763..e2ee2785a5d 100644 --- a/libs/package-lock.json +++ b/libs/package-lock.json @@ -2686,29 +2686,31 @@ } }, "@solana/web3.js": { - "version": "1.53.0", - "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.53.0.tgz", - "integrity": "sha512-QyQDA9U5b+AiTo1ANsj9WihWWECeLv6VRpiTE7xPe5hLYANXZYecnlLglNiEzVgRg/jLvR5DrCISXhHx/mAEJw==", + "version": "1.37.1", + "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.37.1.tgz", + "integrity": "sha512-1zm1blRU6ANb8bOfONibKkNKoMyzE1e0Z88MagyRLF1AmfHc+18lFvqxSQKUdazLMHcioZ28h+GfyAaeCT63iA==", "requires": { "@babel/runtime": "^7.12.5", "@ethersproject/sha2": "^5.5.0", "@solana/buffer-layout": "^4.0.0", - "bigint-buffer": "^1.1.5", "bn.js": "^5.0.0", "borsh": "^0.7.0", "bs58": "^4.0.1", "buffer": "6.0.1", - "fast-stable-stringify": "^1.0.0", + "cross-fetch": "^3.1.4", "jayson": "^3.4.4", "js-sha3": "^0.8.0", - "node-fetch": "2", - "react-native-url-polyfill": "^1.3.0", - "rpc-websockets": "^7.5.0", + "rpc-websockets": "^7.4.2", "secp256k1": "^4.0.2", "superstruct": "^0.14.2", - "tweetnacl": "^1.0.3" + "tweetnacl": "^1.0.0" }, "dependencies": { + "bn.js": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", + "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + }, "borsh": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/borsh/-/borsh-0.7.0.tgz", @@ -4126,6 +4128,16 @@ "expect": "*" } }, + "@types/express-serve-static-core": { + "version": "4.17.28", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.28.tgz", + "integrity": "sha512-P1BJAEAW3E2DJUlkgq4tOL3RyMunoWXqbSCygWo5ZIWTjUgN1YnaXWW4VWl/oc8vs/XoYibEGBKP0uZyF4AHig==", + "requires": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*" + } + }, "@types/form-data": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-2.5.0.tgz", @@ -4181,10 +4193,9 @@ "dev": true }, "@types/lodash": { - "version": "4.14.149", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.149.tgz", - "integrity": "sha512-ijGqzZt/b7BfzcK9vTrS6MFljQRPn5BFWOx8oE0GYxribu6uV+aA9zZuXI1zc/etK9E8nrgdoF2+LgUw7+9tJQ==", - "dev": true + "version": "4.14.181", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.181.tgz", + "integrity": "sha512-n3tyKthHJbkiWhDZs3DkhkCzt2MexYHXlX0td5iMplyfwketaOeKboEVBqzceH7juqvEg3q5oUoBFxSLu7zFag==" }, "@types/long": { "version": "4.0.1", @@ -4234,6 +4245,16 @@ "query-string": "^6.3.0" } }, + "@types/qs": { + "version": "6.9.7", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", + "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==" + }, + "@types/range-parser": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", + "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==" + }, "@types/resolve": { "version": "1.17.1", "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", @@ -4970,14 +4991,6 @@ "resolved": "https://registry.npmjs.org/bech32/-/bech32-2.0.0.tgz", "integrity": "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==" }, - "bigint-buffer": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/bigint-buffer/-/bigint-buffer-1.1.5.tgz", - "integrity": "sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA==", - "requires": { - "bindings": "^1.3.0" - } - }, "binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -5574,6 +5587,11 @@ "safe-buffer": "^5.0.1" } }, + "circular-json": { + "version": "0.5.9", + "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.5.9.tgz", + "integrity": "sha512-4ivwqHpIFJZBuhN3g/pEcdbnGUywkBblloGbkglyloVjjR3uT6tieI89MVOfbP2tHX5sgb01FuLgAOzebNlJNQ==" + }, "class-is": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/class-is/-/class-is-1.1.0.tgz", @@ -6545,7 +6563,7 @@ "es6-promisify": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", - "integrity": "sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==", + "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", "requires": { "es6-promise": "^4.0.3" } @@ -7763,7 +7781,7 @@ "eyes": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", - "integrity": "sha512-GipyPsXO1anza0AOZdy69Im7hGFCNB7Y/NGjDlZGJ3GJJLtwNSb2vrzYrTYJRrRloVx7pl+bhUaTB8yiccPvFQ==" + "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=" }, "fast-deep-equal": { "version": "3.1.3", @@ -7806,11 +7824,6 @@ "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", "dev": true }, - "fast-stable-stringify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fast-stable-stringify/-/fast-stable-stringify-1.0.0.tgz", - "integrity": "sha512-wpYMUmFu5f00Sm0cj2pfivpmawLZ0NKdviQ4w9zJeR8JVtOpOxHmLaJuj0vxvGqMJQWyP/COUkF75/57OKyRag==" - }, "fastq": { "version": "1.13.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", @@ -9080,11 +9093,13 @@ "dev": true }, "jayson": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/jayson/-/jayson-3.7.0.tgz", - "integrity": "sha512-tfy39KJMrrXJ+mFcMpxwBvFDetS8LAID93+rycFglIQM4kl3uNR3W4lBLE/FFhsoUCEox5Dt2adVpDm/XtebbQ==", + "version": "3.6.6", + "resolved": "https://registry.npmjs.org/jayson/-/jayson-3.6.6.tgz", + "integrity": "sha512-f71uvrAWTtrwoww6MKcl9phQTC+56AopLyEenWvKVAIMz+q0oVGj6tenLZ7Z6UiPBkJtKLj4kt0tACllFQruGQ==", "requires": { "@types/connect": "^3.4.33", + "@types/express-serve-static-core": "^4.17.9", + "@types/lodash": "^4.14.159", "@types/node": "^12.12.54", "@types/ws": "^7.4.4", "JSONStream": "^1.3.5", @@ -9100,9 +9115,9 @@ }, "dependencies": { "@types/node": { - "version": "12.20.55", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", - "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==" + "version": "12.20.48", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.48.tgz", + "integrity": "sha512-4kxzqkrpwYtn6okJUcb2lfUu9ilnb3yhUOH6qX3nug8D2DupZ2drIkff2yJzYcNJVl3begnlcaBJ7tqiTTzjnQ==" }, "commander": { "version": "2.20.3", @@ -9441,7 +9456,7 @@ "jsonparse": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", - "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==" + "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=" }, "jsonschema": { "version": "1.2.6", @@ -11334,14 +11349,6 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, - "react-native-url-polyfill": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/react-native-url-polyfill/-/react-native-url-polyfill-1.3.0.tgz", - "integrity": "sha512-w9JfSkvpqqlix9UjDvJjm1EjSt652zVQ6iwCIj1cVVkwXf4jQhQgTNXY6EVTwuAmUjg6BC6k9RHCBynoLFo3IQ==", - "requires": { - "whatwg-url-without-unicode": "8.0.0-3" - } - }, "read-pkg": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", @@ -11761,27 +11768,23 @@ } }, "rpc-websockets": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-7.5.0.tgz", - "integrity": "sha512-9tIRi1uZGy7YmDjErf1Ax3wtqdSSLIlnmL5OtOzgd5eqPKbsPpwDP5whUDO2LQay3Xp0CcHlcNSGzacNRluBaQ==", + "version": "7.4.17", + "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-7.4.17.tgz", + "integrity": "sha512-eolVi/qlXS13viIUH9aqrde902wzSLAai0IjmOZSRefp5I3CSG/vCnD0c0fDSYCWuEyUoRL1BHQA8K1baEUyow==", "requires": { - "@babel/runtime": "^7.17.2", + "@babel/runtime": "^7.11.2", "bufferutil": "^4.0.1", + "circular-json": "^0.5.9", "eventemitter3": "^4.0.7", "utf-8-validate": "^5.0.2", - "uuid": "^8.3.2", - "ws": "^8.5.0" + "uuid": "^8.3.0", + "ws": "^7.4.5" }, "dependencies": { "uuid": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" - }, - "ws": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.8.1.tgz", - "integrity": "sha512-bGy2JzvzkPowEJV++hF07hAD6niYSr0JzBNo/J29WsB57A2r7Wlc1UFcTR9IzrPvuNVO4B8LGqF8qcpsVOhJCA==" } } }, @@ -14136,32 +14139,6 @@ "webidl-conversions": "^3.0.0" } }, - "whatwg-url-without-unicode": { - "version": "8.0.0-3", - "resolved": "https://registry.npmjs.org/whatwg-url-without-unicode/-/whatwg-url-without-unicode-8.0.0-3.tgz", - "integrity": "sha512-HoKuzZrUlgpz35YO27XgD28uh/WJH4B0+3ttFqRo//lmq+9T/mIOJ6kqmINI9HpUpz1imRC/nR/lxKpJiv0uig==", - "requires": { - "buffer": "^5.4.3", - "punycode": "^2.1.1", - "webidl-conversions": "^5.0.0" - }, - "dependencies": { - "buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "requires": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "webidl-conversions": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz", - "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==" - } - } - }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", diff --git a/libs/package.json b/libs/package.json index ce259784d73..8b7b0dc04a7 100644 --- a/libs/package.json +++ b/libs/package.json @@ -45,7 +45,7 @@ "@improbable-eng/grpc-web-node-http-transport": "0.15.0", "@project-serum/anchor": "0.24.1", "@solana/spl-token": "0.1.8", - "@solana/web3.js": "1.53.0", + "@solana/web3.js": "1.37.1", "abi-decoder": "2.4.0", "ajv": "6.12.2", "async-retry": "1.3.1", @@ -98,7 +98,6 @@ "@types/expect": "24.3.0", "@types/form-data": "^2.5.0", "@types/hashids": "2.0.1", - "@types/lodash": "4.14.149", "@types/mocha": "9.1.0", "@types/node-localstorage": "1.3.0", "@types/pify": "^5.0.1", diff --git a/libs/src/NativeAudiusLibs.ts b/libs/src/NativeAudiusLibs.ts index cfd32223c2e..edbf67f3cf5 100644 --- a/libs/src/NativeAudiusLibs.ts +++ b/libs/src/NativeAudiusLibs.ts @@ -1,6 +1,7 @@ import type { provider } from 'web3-core' import Web3 from './LibsWeb3' import { version } from './version' +import type { SolanaWeb3Config } from './services/solana' import { Hedgehog, HedgehogConfig } from './services/hedgehog' import type { Hedgehog as HedgehogBase } from '@audius/hedgehog' import { CreatorNode, CreatorNodeConfig } from './services/creatorNode' @@ -13,19 +14,12 @@ import { UserStateManager } from './userStateManager' import type { Logger, CaptchaConfig, Nullable } from './utils' import { Captcha, Utils } from './utils' -import { Keypair, PublicKey } from '@solana/web3.js' - import { getPlatformLocalStorage, LocalStorage } from './utils/localStorage' import { Web3Config, Web3Manager } from './services/web3Manager' import { EthWeb3Config, EthWeb3Manager } from './services/ethWeb3Manager' import { Comstock } from './services/comstock' import { IdentityService } from './services/identity' import { EthContracts } from './services/ethContracts' -import { - SolanaWeb3Manager, - SolanaUtils, - SolanaWeb3Config -} from './services/solana' import { AudiusContracts } from './services/dataContracts' import { Account } from './api/Account' import { Users } from './api/Users' @@ -48,11 +42,6 @@ type LibsHedgehogConfig = Omit< 'identityService' | 'localStorage' > -type LibsSolanaWeb3Config = SolanaWeb3Config & { - // fee payer secret keys, if client wants to switch between different fee payers during relay - feePayerSecretKeys?: Uint8Array[] -} - type LibsDiscoveryProviderConfig = Omit< DiscoveryProviderConfig, 'userStateManager' | 'ethContracts' | 'web3Manager' @@ -228,51 +217,10 @@ export class AudiusLibs { /** * Configures a solana web3 + * This is a stubbed version for native */ - static configSolanaWeb3({ - solanaClusterEndpoint, - mintAddress, - solanaTokenAddress, - claimableTokenPDA, - feePayerAddress, - claimableTokenProgramAddress, - rewardsManagerProgramId, - rewardsManagerProgramPDA, - rewardsManagerTokenPDA, - useRelay, - feePayerSecretKeys, - confirmationTimeout, - audiusDataAdminStorageKeypairPublicKey, - audiusDataProgramId, - audiusDataIdl - }: LibsSolanaWeb3Config): SolanaWeb3Config { - if (audiusDataAdminStorageKeypairPublicKey instanceof String) { - audiusDataAdminStorageKeypairPublicKey = new PublicKey( - audiusDataAdminStorageKeypairPublicKey - ) - } - if (audiusDataProgramId instanceof String) { - audiusDataProgramId = new PublicKey(audiusDataProgramId) - } - return { - solanaClusterEndpoint, - mintAddress, - solanaTokenAddress, - claimableTokenPDA, - feePayerAddress, - claimableTokenProgramAddress, - rewardsManagerProgramId, - rewardsManagerProgramPDA, - rewardsManagerTokenPDA, - useRelay, - feePayerKeypairs: feePayerSecretKeys?.map((key) => - Keypair.fromSecretKey(key) - ), - confirmationTimeout, - audiusDataAdminStorageKeypairPublicKey, - audiusDataProgramId, - audiusDataIdl - } + static configSolanaWeb3() { + return {} } /** @@ -306,7 +254,7 @@ export class AudiusLibs { ethWeb3Manager: Nullable ethContracts: Nullable web3Manager: Nullable - solanaWeb3Manager: Nullable + // solanaWeb3Manager: Nullable contracts: Nullable creatorNode: Nullable captcha: Nullable @@ -379,7 +327,7 @@ export class AudiusLibs { this.ethWeb3Manager = null this.ethContracts = null this.web3Manager = null - this.solanaWeb3Manager = null + // this.solanaWeb3Manager = null this.contracts = null this.creatorNode = null this.captcha = null @@ -456,14 +404,6 @@ export class AudiusLibs { this.identityService.setWeb3Manager(this.web3Manager) } } - if (this.solanaWeb3Config) { - this.solanaWeb3Manager = new SolanaWeb3Manager( - this.solanaWeb3Config, - this.identityService, - this.web3Manager - ) - await this.solanaWeb3Manager.init() - } /** Contracts - Eth and Data Contracts */ const contractsToInit = [] @@ -549,7 +489,7 @@ export class AudiusLibs { this.contracts, this.ethWeb3Manager, this.ethContracts, - this.solanaWeb3Manager, + null as any, null as any, null as any, this.creatorNode, @@ -575,7 +515,5 @@ export class AudiusLibs { } } -export { SolanaUtils } - export { Utils } from './utils' export { SanityChecks } from './sanityChecks' diff --git a/libs/src/services/solana/SolanaWeb3Manager.ts b/libs/src/services/solana/SolanaWeb3Manager.ts index 9c0bb94329f..6e129417cc7 100644 --- a/libs/src/services/solana/SolanaWeb3Manager.ts +++ b/libs/src/services/solana/SolanaWeb3Manager.ts @@ -1,8 +1,7 @@ -import * as solanaWeb3 from '@solana/web3.js' -import { Connection, Keypair, PublicKey } from '@solana/web3.js' +import solanaWeb3, { Connection, Keypair, PublicKey } from '@solana/web3.js' import type BN from 'bn.js' import splToken from '@solana/spl-token' -import anchor, { Address, Idl, Program, Wallet } from '@project-serum/anchor' +import anchor, { Address, Idl, Program } from '@project-serum/anchor' import { idl } from '@audius/anchor-audius-data' import { transferWAudioBalance } from './transfer' @@ -167,7 +166,7 @@ export class SolanaWeb3Manager { } = this.solanaWeb3Config this.solanaClusterEndpoint = solanaClusterEndpoint - this.connection = new Connection(this.solanaClusterEndpoint, { + this.connection = new solanaWeb3.Connection(this.solanaClusterEndpoint, { confirmTransactionInitialTimeout: confirmationTimeout || DEFAULT_CONNECTION_CONFIRMATION_TIMEOUT_MS }) @@ -231,13 +230,14 @@ export class SolanaWeb3Manager { this.audiusDataAdminStorageKeypairPublicKey && this.audiusDataIdl ) { - const connection = new Connection( + const connection = new solanaWeb3.Connection( this.solanaClusterEndpoint, anchor.AnchorProvider.defaultOptions() ) const anchorProvider = new anchor.AnchorProvider( connection, - Keypair.generate() as unknown as Wallet, + // @ts-expect-error weirdness with 3rd party types + solanaWeb3.Keypair.generate(), anchor.AnchorProvider.defaultOptions() ) this.anchorProgram = new anchor.Program( diff --git a/libs/src/services/wormhole/Wormhole.ts b/libs/src/services/wormhole/Wormhole.ts index 04fe767d1f6..a2ab4303d7a 100644 --- a/libs/src/services/wormhole/Wormhole.ts +++ b/libs/src/services/wormhole/Wormhole.ts @@ -1,5 +1,4 @@ import type { Hedgehog } from '@audius/hedgehog' -import { Keypair } from '@solana/web3.js' import type { EthContracts } from '../ethContracts' import type { ContractReceipt } from 'ethers' import type { EthWeb3Manager } from '../ethWeb3Manager' @@ -270,9 +269,10 @@ export class Wormhole { const wAudioAmount = wAudioFromWeiAudio(amount) // Generate a solana keypair derived from the hedgehog private key // NOTE: The into to fromSeed is a 32 bytes Uint8Array - const rootSolanaAccount = Keypair.fromSeed( - this.hedgehog.wallet?.getPrivateKey() as Uint8Array - ) + const rootSolanaAccount = + this.solanaWeb3Manager.solanaWeb3.Keypair.fromSeed( + this.hedgehog.wallet?.getPrivateKey() as Uint8Array + ) const solanaAddress = rootSolanaAccount.publicKey.toString() logs.push(`Root Solana Account: ${solanaAddress}`) diff --git a/service-commands/package-lock.json b/service-commands/package-lock.json index 5359bc08b5a..93e3913800f 100644 --- a/service-commands/package-lock.json +++ b/service-commands/package-lock.json @@ -117,39 +117,6 @@ "@ethersproject/strings": "^5.0.4" } }, - "@solana/web3.js": { - "version": "1.37.1", - "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.37.1.tgz", - "integrity": "sha512-1zm1blRU6ANb8bOfONibKkNKoMyzE1e0Z88MagyRLF1AmfHc+18lFvqxSQKUdazLMHcioZ28h+GfyAaeCT63iA==", - "requires": { - "@babel/runtime": "^7.12.5", - "@ethersproject/sha2": "^5.5.0", - "@solana/buffer-layout": "^4.0.0", - "bn.js": "^5.0.0", - "borsh": "^0.7.0", - "bs58": "^4.0.1", - "buffer": "6.0.1", - "cross-fetch": "^3.1.4", - "jayson": "^3.4.4", - "js-sha3": "^0.8.0", - "rpc-websockets": "^7.4.2", - "secp256k1": "^4.0.2", - "superstruct": "^0.14.2", - "tweetnacl": "^1.0.0" - }, - "dependencies": { - "borsh": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/borsh/-/borsh-0.7.0.tgz", - "integrity": "sha512-CLCsZGIBCFnPtkNnieW/a8wmreDmfUtjU2m9yHrzPXIlNbqVs0AQrSatSG6vdNYUqdc83tkQi2eHfF98ubzQLA==", - "requires": { - "bn.js": "^5.2.0", - "bs58": "^4.0.0", - "text-encoding-utf-8": "^1.0.2" - } - } - } - }, "@types/bn.js": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.0.tgz", @@ -163,15 +130,6 @@ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" }, - "buffer": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.1.tgz", - "integrity": "sha512-rVAXBwEcEoYtxnHSO5iWyhzV/O1WMtkUYWlfdLS7FjU4PnSJJHEfHXi/uHPI5EwltmOA794gN3bm3/pzuctWjQ==", - "requires": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, "elliptic": { "version": "6.5.4", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", @@ -1572,33 +1530,30 @@ } }, "@solana/web3.js": { - "version": "1.53.0", - "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.53.0.tgz", - "integrity": "sha512-QyQDA9U5b+AiTo1ANsj9WihWWECeLv6VRpiTE7xPe5hLYANXZYecnlLglNiEzVgRg/jLvR5DrCISXhHx/mAEJw==", + "version": "1.37.1", + "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.37.1.tgz", + "integrity": "sha512-1zm1blRU6ANb8bOfONibKkNKoMyzE1e0Z88MagyRLF1AmfHc+18lFvqxSQKUdazLMHcioZ28h+GfyAaeCT63iA==", "requires": { "@babel/runtime": "^7.12.5", "@ethersproject/sha2": "^5.5.0", "@solana/buffer-layout": "^4.0.0", - "bigint-buffer": "^1.1.5", "bn.js": "^5.0.0", "borsh": "^0.7.0", "bs58": "^4.0.1", "buffer": "6.0.1", - "fast-stable-stringify": "^1.0.0", + "cross-fetch": "^3.1.4", "jayson": "^3.4.4", "js-sha3": "^0.8.0", - "node-fetch": "2", - "react-native-url-polyfill": "^1.3.0", - "rpc-websockets": "^7.5.0", + "rpc-websockets": "^7.4.2", "secp256k1": "^4.0.2", "superstruct": "^0.14.2", - "tweetnacl": "^1.0.3" + "tweetnacl": "^1.0.0" }, "dependencies": { "bn.js": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", - "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", + "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" }, "borsh": { "version": "0.7.0", @@ -1901,12 +1856,27 @@ "@types/node": "*" } }, + "@types/express-serve-static-core": { + "version": "4.17.28", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.28.tgz", + "integrity": "sha512-P1BJAEAW3E2DJUlkgq4tOL3RyMunoWXqbSCygWo5ZIWTjUgN1YnaXWW4VWl/oc8vs/XoYibEGBKP0uZyF4AHig==", + "requires": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*" + } + }, "@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", "dev": true }, + "@types/lodash": { + "version": "4.14.182", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.182.tgz", + "integrity": "sha512-/THyiqyQAP9AfARo4pF+aCGcyiQ94tX/Is2I7HofNRqoYLgN1PBoOWu2/zTA5zMxzP5EFutMtWtGAFRKUe961Q==" + }, "@types/long": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", @@ -1925,6 +1895,16 @@ "@types/node": "*" } }, + "@types/qs": { + "version": "6.9.7", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", + "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==" + }, + "@types/range-parser": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", + "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==" + }, "@types/secp256k1": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.3.tgz", @@ -2403,14 +2383,6 @@ "resolved": "https://registry.npmjs.org/bech32/-/bech32-2.0.0.tgz", "integrity": "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==" }, - "bigint-buffer": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/bigint-buffer/-/bigint-buffer-1.1.5.tgz", - "integrity": "sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA==", - "requires": { - "bindings": "^1.3.0" - } - }, "bignumber.js": { "version": "9.0.2", "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.2.tgz", @@ -3502,7 +3474,7 @@ "es6-promisify": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", - "integrity": "sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==", + "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", "requires": { "es6-promise": "^4.0.3" } @@ -4280,7 +4252,7 @@ "eyes": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", - "integrity": "sha512-GipyPsXO1anza0AOZdy69Im7hGFCNB7Y/NGjDlZGJ3GJJLtwNSb2vrzYrTYJRrRloVx7pl+bhUaTB8yiccPvFQ==" + "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=" }, "fast-deep-equal": { "version": "3.1.3", @@ -4304,11 +4276,6 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, - "fast-stable-stringify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fast-stable-stringify/-/fast-stable-stringify-1.0.0.tgz", - "integrity": "sha512-wpYMUmFu5f00Sm0cj2pfivpmawLZ0NKdviQ4w9zJeR8JVtOpOxHmLaJuj0vxvGqMJQWyP/COUkF75/57OKyRag==" - }, "fecha": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.1.tgz", @@ -5500,11 +5467,13 @@ } }, "jayson": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/jayson/-/jayson-3.7.0.tgz", - "integrity": "sha512-tfy39KJMrrXJ+mFcMpxwBvFDetS8LAID93+rycFglIQM4kl3uNR3W4lBLE/FFhsoUCEox5Dt2adVpDm/XtebbQ==", + "version": "3.6.6", + "resolved": "https://registry.npmjs.org/jayson/-/jayson-3.6.6.tgz", + "integrity": "sha512-f71uvrAWTtrwoww6MKcl9phQTC+56AopLyEenWvKVAIMz+q0oVGj6tenLZ7Z6UiPBkJtKLj4kt0tACllFQruGQ==", "requires": { "@types/connect": "^3.4.33", + "@types/express-serve-static-core": "^4.17.9", + "@types/lodash": "^4.14.159", "@types/node": "^12.12.54", "@types/ws": "^7.4.4", "JSONStream": "^1.3.5", @@ -5520,9 +5489,9 @@ }, "dependencies": { "@types/node": { - "version": "12.20.55", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", - "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==" + "version": "12.20.50", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.50.tgz", + "integrity": "sha512-+9axpWx2b2JCVovr7Ilgt96uc6C1zBKOQMpGtRbWT9IoR/8ue32GGMfGA4woP8QyP2gBs6GQWEVM3tCybGCxDA==" }, "commander": { "version": "2.20.3", @@ -5627,7 +5596,7 @@ "jsonparse": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", - "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==" + "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=" }, "jsonschema": { "version": "1.2.6", @@ -6688,14 +6657,6 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, - "react-native-url-polyfill": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/react-native-url-polyfill/-/react-native-url-polyfill-1.3.0.tgz", - "integrity": "sha512-w9JfSkvpqqlix9UjDvJjm1EjSt652zVQ6iwCIj1cVVkwXf4jQhQgTNXY6EVTwuAmUjg6BC6k9RHCBynoLFo3IQ==", - "requires": { - "whatwg-url-without-unicode": "8.0.0-3" - } - }, "read-pkg": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", @@ -6869,9 +6830,9 @@ "integrity": "sha512-rZqFD43y4U9nSqVq3iyWBiDwmBQJY8Txi04yI9jTKD3xcl7CbFjh1qRpQshUB3sONLubDzm7vJiwB+1MEGv67w==" }, "rpc-websockets": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-7.5.0.tgz", - "integrity": "sha512-9tIRi1uZGy7YmDjErf1Ax3wtqdSSLIlnmL5OtOzgd5eqPKbsPpwDP5whUDO2LQay3Xp0CcHlcNSGzacNRluBaQ==", + "version": "7.4.18", + "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-7.4.18.tgz", + "integrity": "sha512-bVu+4qM5CkGVlTqJa6FaAxLbb5uRnyH4te7yjFvoCzbnif7PT4BcvXtNTprHlNvsH+/StB81zUQicxMrUrIomA==", "requires": { "@babel/runtime": "^7.17.2", "bufferutil": "^4.0.1", @@ -6892,9 +6853,9 @@ "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" }, "ws": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.8.1.tgz", - "integrity": "sha512-bGy2JzvzkPowEJV++hF07hAD6niYSr0JzBNo/J29WsB57A2r7Wlc1UFcTR9IzrPvuNVO4B8LGqF8qcpsVOhJCA==" + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz", + "integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==" } } }, @@ -8290,32 +8251,6 @@ "webidl-conversions": "^3.0.0" } }, - "whatwg-url-without-unicode": { - "version": "8.0.0-3", - "resolved": "https://registry.npmjs.org/whatwg-url-without-unicode/-/whatwg-url-without-unicode-8.0.0-3.tgz", - "integrity": "sha512-HoKuzZrUlgpz35YO27XgD28uh/WJH4B0+3ttFqRo//lmq+9T/mIOJ6kqmINI9HpUpz1imRC/nR/lxKpJiv0uig==", - "requires": { - "buffer": "^5.4.3", - "punycode": "^2.1.1", - "webidl-conversions": "^5.0.0" - }, - "dependencies": { - "buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "requires": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "webidl-conversions": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz", - "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==" - } - } - }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", diff --git a/service-commands/package.json b/service-commands/package.json index b090f84968b..54c720956c9 100644 --- a/service-commands/package.json +++ b/service-commands/package.json @@ -9,7 +9,7 @@ }, "dependencies": { "@audius/sdk": "0.0.32", - "@solana/web3.js": "1.53.0", + "@solana/web3.js": "1.37.1", "axios": "0.19.2", "borsh": "0.4.0", "colors": "1.4.0", From 8090f842dcdc81b2e3b2a9fcc3756bf5a90f9489 Mon Sep 17 00:00:00 2001 From: Dylan Jeffers Date: Thu, 18 Aug 2022 11:06:11 -0700 Subject: [PATCH 2/3] Revert solanaweb3 version --- libs/package-lock.json | 14 ++-- libs/package.json | 1 + libs/src/NativeAudiusLibs.ts | 76 +++++++++++++++++-- libs/src/services/solana/SolanaWeb3Manager.ts | 7 +- 4 files changed, 80 insertions(+), 18 deletions(-) diff --git a/libs/package-lock.json b/libs/package-lock.json index e2ee2785a5d..feba01bb687 100644 --- a/libs/package-lock.json +++ b/libs/package-lock.json @@ -4193,9 +4193,10 @@ "dev": true }, "@types/lodash": { - "version": "4.14.181", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.181.tgz", - "integrity": "sha512-n3tyKthHJbkiWhDZs3DkhkCzt2MexYHXlX0td5iMplyfwketaOeKboEVBqzceH7juqvEg3q5oUoBFxSLu7zFag==" + "version": "4.14.149", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.149.tgz", + "integrity": "sha512-ijGqzZt/b7BfzcK9vTrS6MFljQRPn5BFWOx8oE0GYxribu6uV+aA9zZuXI1zc/etK9E8nrgdoF2+LgUw7+9tJQ==", + "dev": true }, "@types/long": { "version": "4.0.1", @@ -6563,7 +6564,7 @@ "es6-promisify": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", - "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", + "integrity": "sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==", "requires": { "es6-promise": "^4.0.3" } @@ -7781,7 +7782,7 @@ "eyes": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", - "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=" + "integrity": "sha512-GipyPsXO1anza0AOZdy69Im7hGFCNB7Y/NGjDlZGJ3GJJLtwNSb2vrzYrTYJRrRloVx7pl+bhUaTB8yiccPvFQ==" }, "fast-deep-equal": { "version": "3.1.3", @@ -9099,7 +9100,6 @@ "requires": { "@types/connect": "^3.4.33", "@types/express-serve-static-core": "^4.17.9", - "@types/lodash": "^4.14.159", "@types/node": "^12.12.54", "@types/ws": "^7.4.4", "JSONStream": "^1.3.5", @@ -9456,7 +9456,7 @@ "jsonparse": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", - "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=" + "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==" }, "jsonschema": { "version": "1.2.6", diff --git a/libs/package.json b/libs/package.json index 8b7b0dc04a7..a7d8c496e6b 100644 --- a/libs/package.json +++ b/libs/package.json @@ -98,6 +98,7 @@ "@types/expect": "24.3.0", "@types/form-data": "^2.5.0", "@types/hashids": "2.0.1", + "@types/lodash": "4.14.149", "@types/mocha": "9.1.0", "@types/node-localstorage": "1.3.0", "@types/pify": "^5.0.1", diff --git a/libs/src/NativeAudiusLibs.ts b/libs/src/NativeAudiusLibs.ts index edbf67f3cf5..cfd32223c2e 100644 --- a/libs/src/NativeAudiusLibs.ts +++ b/libs/src/NativeAudiusLibs.ts @@ -1,7 +1,6 @@ import type { provider } from 'web3-core' import Web3 from './LibsWeb3' import { version } from './version' -import type { SolanaWeb3Config } from './services/solana' import { Hedgehog, HedgehogConfig } from './services/hedgehog' import type { Hedgehog as HedgehogBase } from '@audius/hedgehog' import { CreatorNode, CreatorNodeConfig } from './services/creatorNode' @@ -14,12 +13,19 @@ import { UserStateManager } from './userStateManager' import type { Logger, CaptchaConfig, Nullable } from './utils' import { Captcha, Utils } from './utils' +import { Keypair, PublicKey } from '@solana/web3.js' + import { getPlatformLocalStorage, LocalStorage } from './utils/localStorage' import { Web3Config, Web3Manager } from './services/web3Manager' import { EthWeb3Config, EthWeb3Manager } from './services/ethWeb3Manager' import { Comstock } from './services/comstock' import { IdentityService } from './services/identity' import { EthContracts } from './services/ethContracts' +import { + SolanaWeb3Manager, + SolanaUtils, + SolanaWeb3Config +} from './services/solana' import { AudiusContracts } from './services/dataContracts' import { Account } from './api/Account' import { Users } from './api/Users' @@ -42,6 +48,11 @@ type LibsHedgehogConfig = Omit< 'identityService' | 'localStorage' > +type LibsSolanaWeb3Config = SolanaWeb3Config & { + // fee payer secret keys, if client wants to switch between different fee payers during relay + feePayerSecretKeys?: Uint8Array[] +} + type LibsDiscoveryProviderConfig = Omit< DiscoveryProviderConfig, 'userStateManager' | 'ethContracts' | 'web3Manager' @@ -217,10 +228,51 @@ export class AudiusLibs { /** * Configures a solana web3 - * This is a stubbed version for native */ - static configSolanaWeb3() { - return {} + static configSolanaWeb3({ + solanaClusterEndpoint, + mintAddress, + solanaTokenAddress, + claimableTokenPDA, + feePayerAddress, + claimableTokenProgramAddress, + rewardsManagerProgramId, + rewardsManagerProgramPDA, + rewardsManagerTokenPDA, + useRelay, + feePayerSecretKeys, + confirmationTimeout, + audiusDataAdminStorageKeypairPublicKey, + audiusDataProgramId, + audiusDataIdl + }: LibsSolanaWeb3Config): SolanaWeb3Config { + if (audiusDataAdminStorageKeypairPublicKey instanceof String) { + audiusDataAdminStorageKeypairPublicKey = new PublicKey( + audiusDataAdminStorageKeypairPublicKey + ) + } + if (audiusDataProgramId instanceof String) { + audiusDataProgramId = new PublicKey(audiusDataProgramId) + } + return { + solanaClusterEndpoint, + mintAddress, + solanaTokenAddress, + claimableTokenPDA, + feePayerAddress, + claimableTokenProgramAddress, + rewardsManagerProgramId, + rewardsManagerProgramPDA, + rewardsManagerTokenPDA, + useRelay, + feePayerKeypairs: feePayerSecretKeys?.map((key) => + Keypair.fromSecretKey(key) + ), + confirmationTimeout, + audiusDataAdminStorageKeypairPublicKey, + audiusDataProgramId, + audiusDataIdl + } } /** @@ -254,7 +306,7 @@ export class AudiusLibs { ethWeb3Manager: Nullable ethContracts: Nullable web3Manager: Nullable - // solanaWeb3Manager: Nullable + solanaWeb3Manager: Nullable contracts: Nullable creatorNode: Nullable captcha: Nullable @@ -327,7 +379,7 @@ export class AudiusLibs { this.ethWeb3Manager = null this.ethContracts = null this.web3Manager = null - // this.solanaWeb3Manager = null + this.solanaWeb3Manager = null this.contracts = null this.creatorNode = null this.captcha = null @@ -404,6 +456,14 @@ export class AudiusLibs { this.identityService.setWeb3Manager(this.web3Manager) } } + if (this.solanaWeb3Config) { + this.solanaWeb3Manager = new SolanaWeb3Manager( + this.solanaWeb3Config, + this.identityService, + this.web3Manager + ) + await this.solanaWeb3Manager.init() + } /** Contracts - Eth and Data Contracts */ const contractsToInit = [] @@ -489,7 +549,7 @@ export class AudiusLibs { this.contracts, this.ethWeb3Manager, this.ethContracts, - null as any, + this.solanaWeb3Manager, null as any, null as any, this.creatorNode, @@ -515,5 +575,7 @@ export class AudiusLibs { } } +export { SolanaUtils } + export { Utils } from './utils' export { SanityChecks } from './sanityChecks' diff --git a/libs/src/services/solana/SolanaWeb3Manager.ts b/libs/src/services/solana/SolanaWeb3Manager.ts index 6e129417cc7..5c2193f6626 100644 --- a/libs/src/services/solana/SolanaWeb3Manager.ts +++ b/libs/src/services/solana/SolanaWeb3Manager.ts @@ -1,7 +1,7 @@ import solanaWeb3, { Connection, Keypair, PublicKey } from '@solana/web3.js' import type BN from 'bn.js' import splToken from '@solana/spl-token' -import anchor, { Address, Idl, Program } from '@project-serum/anchor' +import anchor, { Address, Idl, Program, Wallet } from '@project-serum/anchor' import { idl } from '@audius/anchor-audius-data' import { transferWAudioBalance } from './transfer' @@ -166,7 +166,7 @@ export class SolanaWeb3Manager { } = this.solanaWeb3Config this.solanaClusterEndpoint = solanaClusterEndpoint - this.connection = new solanaWeb3.Connection(this.solanaClusterEndpoint, { + this.connection = new Connection(this.solanaClusterEndpoint, { confirmTransactionInitialTimeout: confirmationTimeout || DEFAULT_CONNECTION_CONFIRMATION_TIMEOUT_MS }) @@ -236,8 +236,7 @@ export class SolanaWeb3Manager { ) const anchorProvider = new anchor.AnchorProvider( connection, - // @ts-expect-error weirdness with 3rd party types - solanaWeb3.Keypair.generate(), + Keypair.generate() as unknown as Wallet, anchor.AnchorProvider.defaultOptions() ) this.anchorProgram = new anchor.Program( From 24f1f0aff21906b96a8259d9214ee7f80f4c5f20 Mon Sep 17 00:00:00 2001 From: Dylan Jeffers Date: Thu, 18 Aug 2022 11:08:55 -0700 Subject: [PATCH 3/3] Use named export --- libs/src/services/solana/SolanaWeb3Manager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/src/services/solana/SolanaWeb3Manager.ts b/libs/src/services/solana/SolanaWeb3Manager.ts index 5c2193f6626..e64a6a504c0 100644 --- a/libs/src/services/solana/SolanaWeb3Manager.ts +++ b/libs/src/services/solana/SolanaWeb3Manager.ts @@ -230,7 +230,7 @@ export class SolanaWeb3Manager { this.audiusDataAdminStorageKeypairPublicKey && this.audiusDataIdl ) { - const connection = new solanaWeb3.Connection( + const connection = new Connection( this.solanaClusterEndpoint, anchor.AnchorProvider.defaultOptions() )