diff --git a/package.json b/package.json index 202d9d709..5b991048f 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "rn-placeholder": "^1.3.2", "speakingurl": "^14.0.1", "stacktrace-parser": "0.1.4", - "steemconnect": "^2.0.1" + "steemconnect": "^3.0.4" }, "devDependencies": { "@babel/core": "^7.5.5", diff --git a/src/providers/steem/dsteem.js b/src/providers/steem/dsteem.js index 80521035a..ee46752a0 100644 --- a/src/providers/steem/dsteem.js +++ b/src/providers/steem/dsteem.js @@ -1,5 +1,5 @@ import { Client, PrivateKey } from 'dsteem'; -import steemConnect from 'steemconnect'; +import steemconnect from 'steemconnect'; import Config from 'react-native-config'; import get from 'lodash/get'; @@ -232,7 +232,7 @@ export const ignoreUser = async (currentAccount, pin, data) => { if (currentAccount.local.authType === AUTH_TYPE.STEEM_CONNECT) { const token = decryptKey(currentAccount.local.accessToken, digitPinCode); - const api = steemConnect.Initialize({ + const api = new steemconnect.Client({ accessToken: token, }); @@ -374,7 +374,7 @@ export const deleteComment = (currentAccount, pin, permlink) => { if (currentAccount.local.authType === AUTH_TYPE.STEEM_CONNECT) { const token = decryptKey(currentAccount.local.accessToken, digitPinCode); - const api = steemConnect.Initialize({ + const api = new steemconnect.Client({ accessToken: token, }); @@ -454,7 +454,7 @@ const _vote = async (currentAccount, pin, author, permlink, weight) => { if (currentAccount.local.authType === AUTH_TYPE.STEEM_CONNECT) { const token = decryptKey(currentAccount.local.accessToken, digitPinCode); - const api = steemConnect.Initialize({ + const api = new steemconnect.Client({ accessToken: token, }); @@ -754,7 +754,7 @@ export const followUser = async (currentAccount, pin, data) => { if (currentAccount.local.authType === AUTH_TYPE.STEEM_CONNECT) { const token = decryptKey(get(currentAccount, 'local.accessToken'), digitPinCode); - const api = steemConnect.Initialize({ + const api = new steemconnect.Client({ accessToken: token, }); @@ -798,7 +798,7 @@ export const unfollowUser = async (currentAccount, pin, data) => { if (currentAccount.local.authType === AUTH_TYPE.STEEM_CONNECT) { const token = decryptKey(currentAccount.local.accessToken, digitPinCode); - const api = steemConnect.Initialize({ + const api = new steemconnect.Client({ accessToken: token, }); @@ -910,7 +910,7 @@ const _postContent = async ( if (account.local.authType === AUTH_TYPE.STEEM_CONNECT) { const token = decryptKey(account.local.accessToken, digitPinCode); - const api = steemConnect.Initialize({ + const api = new steemconnect.Client({ accessToken: token, }); @@ -1016,7 +1016,7 @@ const _reblog = async (account, pinCode, author, permlink) => { if (account.local.authType === AUTH_TYPE.STEEM_CONNECT) { const token = decryptKey(account.local.accessToken, pin); - const api = steemConnect.Initialize({ + const api = new steemconnect.Client({ accessToken: token, }); @@ -1055,7 +1055,7 @@ export const claimRewardBalance = (account, pinCode, rewardSteem, rewardSbd, rew if (account.local.authType === AUTH_TYPE.STEEM_CONNECT) { const token = decryptKey(get(account, 'local.accessToken'), pin); - const api = steemConnect.Initialize({ + const api = new steemconnect.Client({ accessToken: token, }); diff --git a/src/providers/steem/steemConnectAPI.js b/src/providers/steem/steemConnectAPI.js index ccda49d20..62e320e4d 100644 --- a/src/providers/steem/steemConnectAPI.js +++ b/src/providers/steem/steemConnectAPI.js @@ -1,6 +1,6 @@ -import sc2 from 'steemconnect'; +import steemconnect from 'steemconnect'; -const api = sc2.Initialize({ +const api = new steemconnect.Client({ app: 'esteem-app', callbackURL: 'http://127.0.0.1:3415', }); diff --git a/yarn.lock b/yarn.lock index fb200e05b..f46273d94 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2748,13 +2748,13 @@ create-react-context@0.2.2: fbjs "^0.8.0" gud "^1.0.0" -cross-fetch@^2.2.2: - version "2.2.3" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-2.2.3.tgz#e8a0b3c54598136e037f8650f8e823ccdfac198e" - integrity sha512-PrWWNH3yL2NYIb/7WF/5vFG3DCQiXDOVf8k3ijatbrtnwNuhMWLC7YF7uqf53tbTFDzHIUD8oITw4Bxt8ST3Nw== +cross-fetch@^3.0.1: + version "3.0.4" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.0.4.tgz#7bef7020207e684a7638ef5f2f698e24d9eb283c" + integrity sha512-MSHgpjQqgbT/94D4CyADeNoYh52zMkCX4pcJvPP5WqPsLFMKjr2TCMg381ox5qI0ii2dPwaLx/00477knXqXVw== dependencies: - node-fetch "2.1.2" - whatwg-fetch "2.0.4" + node-fetch "2.6.0" + whatwg-fetch "3.0.0" cross-spawn@^5.0.1, cross-spawn@^5.1.0: version "5.1.0" @@ -6636,10 +6636,10 @@ nice-try@^1.0.4: resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== -node-fetch@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.1.2.tgz#ab884e8e7e57e38a944753cec706f788d1768bb5" - integrity sha1-q4hOjn5X44qUR1POxwb3iNF2i7U= +node-fetch@2.6.0, node-fetch@^2.1.2, node-fetch@^2.2.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd" + integrity sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA== node-fetch@^1.0.1, node-fetch@^1.7.3: version "1.7.3" @@ -6649,11 +6649,6 @@ node-fetch@^1.0.1, node-fetch@^1.7.3: encoding "^0.1.11" is-stream "^1.0.1" -node-fetch@^2.1.2, node-fetch@^2.2.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd" - integrity sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA== - node-int64@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" @@ -8990,13 +8985,19 @@ stealthy-require@^1.1.1: resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks= -steemconnect@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/steemconnect/-/steemconnect-2.0.1.tgz#bdcec947c18bbc2cb66c8de0bae5bf6582adcec9" - integrity sha512-ympGGVICdTKCWzfUV8/2WTNao/zfsM1J131sbsgSJFr4fu1Ombo5gdNaF6PxOKlcFe3A+ZkkqUJjiBXTqlFuig== +steem-uri@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/steem-uri/-/steem-uri-0.1.1.tgz#20da6f713809398b5f77d251def0eeed92cf966b" + integrity sha512-pHe33AlDLlf2jC8hfrEthVj8Zq/DcFg490ID16KK0o7tr02mToeXTpEFGV5dnM2ASeAr3MAOxCJvEFDrCFuZbQ== + +steemconnect@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/steemconnect/-/steemconnect-3.0.4.tgz#a5c33060cb10a1e525e47714158ad85d73d3dea9" + integrity sha512-m1aCOF80jc4mr0rn3PI+yVRdsdtHxksPbLznSAl0Cnp9hsjzICexeO5T4E6hBU91egG03JRQn3xnQj+c5qQGUA== dependencies: babel-runtime "^6.26.0" - cross-fetch "^2.2.2" + cross-fetch "^3.0.1" + steem-uri "^0.1.1" stream-buffers@~2.2.0: version "2.2.0" @@ -9677,16 +9678,16 @@ whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3: dependencies: iconv-lite "0.4.24" -whatwg-fetch@2.0.4, whatwg-fetch@^2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f" - integrity sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng== - -whatwg-fetch@>=0.10.0: +whatwg-fetch@3.0.0, whatwg-fetch@>=0.10.0: version "3.0.0" resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb" integrity sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q== +whatwg-fetch@^2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f" + integrity sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng== + whatwg-mimetype@^2.1.0, whatwg-mimetype@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf"