Skip to content

Commit e7c915d

Browse files
authored
Merge pull request #132 from torusresearch/develop
Release v1.2.2 [skip ci]
2 parents 1ec6824 + 3af3f9b commit e7c915d

10 files changed

Lines changed: 55 additions & 33 deletions

File tree

examples/angular-example/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/angular-example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"@angular/platform-browser": "~8.2.14",
2020
"@angular/platform-browser-dynamic": "~8.2.14",
2121
"@angular/router": "~8.2.14",
22-
"@toruslabs/torus-embed": "^1.2.0",
22+
"@toruslabs/torus-embed": "^1.2.1",
2323
"human-standard-token-abi": "^2.0.0",
2424
"rxjs": "~6.4.0",
2525
"tslib": "^1.10.0",

examples/react-basic-app/package-lock.json

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/react-basic-app/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6-
"@toruslabs/torus-embed": "^1.2.0",
6+
"@toruslabs/torus-embed": "^1.2.1",
77
"human-standard-token-abi": "^2.0.0",
8-
"react": "^16.13.0",
9-
"react-dom": "^16.13.0",
8+
"react": "^16.13.1",
9+
"react-dom": "^16.13.1",
1010
"react-scripts": "3.4.0",
1111
"web3": "^1.2.6"
1212
},
@@ -37,6 +37,6 @@
3737
"eslint-plugin-import": "^2.20.1",
3838
"eslint-plugin-jsx-a11y": "^6.2.3",
3939
"eslint-plugin-react": "^7.19.0",
40-
"eslint-plugin-react-hooks": "^2.5.0"
40+
"eslint-plugin-react-hooks": "^2.5.1"
4141
}
4242
}

examples/vue-app/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/vue-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"lint": "vue-cli-service lint"
99
},
1010
"dependencies": {
11-
"@toruslabs/torus-embed": "^1.2.0",
11+
"@toruslabs/torus-embed": "^1.2.1",
1212
"core-js": "^3.6.4",
1313
"eth-sig-util": "^2.5.3",
1414
"human-standard-token-abi": "^2.0.0",

examples/vue-app/src/App.vue

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<button @click="signTypedData_v4">sign typed data v4</button>
2424
<button @click="changeProvider">Change Provider</button>
2525
<button @click="sendDai">Send DAI</button>
26+
<button @click="approveKnc">Approve Knc</button>
2627
<div :style="{marginTop: '20px'}">
2728
<select name="verifier" :value="selectedVerifier" @change="onSelectedVerifierChanged">
2829
<option selected value="google">Google</option>
@@ -308,6 +309,22 @@ export default {
308309
)
309310
})
310311
},
312+
approveKnc() {
313+
window.torus.setProvider({ host: 'mainnet' }).finally(() => {
314+
const localWeb3 = window.web3
315+
const instance = new localWeb3.eth.Contract(tokenAbi, '0xdd974D5C2e2928deA5F71b9825b8b646686BD200')
316+
const value = Math.floor(parseFloat(0.01) * 10 ** parseFloat(18)).toString()
317+
instance.methods.approve(this.publicAddress, value).send(
318+
{
319+
from: this.publicAddress
320+
},
321+
(err, hash) => {
322+
if (err) this.console(err)
323+
this.console(hash)
324+
}
325+
)
326+
})
327+
},
311328
async getUserInfo() {
312329
window.torus.getUserInfo().then(this.console).catch(this.console)
313330
},

scripts/updateGistIntegrity.sh

100644100755
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
#!/usr/bin/env bash
22
git clone git@gist.github.com:733405286923fa047af4cb26d167acd4.git ~/gist
3-
PACKAGE_VERSION=$(cat ./src/embed.js | grep app.tor.us | head -1 | awk -F//app.tor.us/ '{ print $2 }' | sed "s/[']//g")
3+
PACKAGE_VERSION=$(cat package.json \
4+
| grep '"version"' \
5+
| head -1 \
6+
| awk -F: '{ print $2 }' \
7+
| sed 's/[",]//g')
48
cd public/
59
HASH="$(cat embed.min.js | openssl dgst -sha384 -binary | openssl base64 -A)"
610
cd ~/gist
7-
echo "<script src=\"https://app.tor.us/$PACKAGE_VERSION/embed.min.js\"
11+
URL=$(echo https://app.tor.us/v"$PACKAGE_VERSION"/embed.min.js | tr -d ' ')
12+
echo "<script src=\"$URL\"
813
integrity=\"sha384-$HASH\"
914
crossorigin=\"anonymous\"></script>" > torus-embed.html
1015

scripts/uploadToAws.sh

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ PACKAGE_VERSION=$(cat package.json \
66
| awk -F: '{ print $2 }' \
77
| sed 's/[",]//g')
88
if [ "$CIRCLE_BRANCH" == 'master' ]; then
9-
URL=$(echo s3://app.tor.us/"$PACKAGE_VERSION" | tr -d ' ')
9+
URL=$(echo s3://app.tor.us/v"$PACKAGE_VERSION" | tr -d ' ')
1010
elif [ "$CIRCLE_BRANCH" == 'staging' ]; then
11-
URL=$(echo s3://staging.tor.us/"$PACKAGE_VERSION" | tr -d ' ')
11+
URL=$(echo s3://staging.tor.us/v"$PACKAGE_VERSION" | tr -d ' ')
1212
fi
1313
aws s3 cp ./public/embed.min.js $URL/embed.min.js

src/embed.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,7 @@ class Torus {
10311031
const preopenInstanceId = getPreopenInstanceId()
10321032
this._handleWindow(preopenInstanceId)
10331033
topupStream.write({ name: 'topup_request', data: { provider, params, preopenInstanceId } })
1034-
} else reject(new Error('User has not logged in yet'))
1034+
} else reject(new Error('User has not initialized in yet'))
10351035
})
10361036
}
10371037
}

0 commit comments

Comments
 (0)