Skip to content

Commit c92ca9f

Browse files
committed
demo docs. keychain.js version updated
1 parent 9f09e55 commit c92ca9f

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

docs/demo/index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,10 +319,9 @@
319319
</div>
320320

321321

322-
<script src="https://cdn.jsdelivr.net/npm/keychain.js@0.0.5/dist/keychain.min.js"></script>
322+
<script src="https://cdn.jsdelivr.net/npm/keychain.js@0.0.6/dist/keychain.min.js"></script>
323323
<script src="https://cdn.jsdelivr.net/gh/ethereumjs/browser-builds/dist/ethereumjs-tx/ethereumjs-tx-1.3.3.min.js"></script>
324324
<script>
325-
const { Keychain } = keychainjs;
326325
const keychain = new Keychain();
327326
keychain.command({command: 'version'}, function(data) {
328327
document.getElementById('version').innerText = data.result ? data.result : '';

docs/eth_signer/index.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ <h6>Documentation: <a href="https://github.com/arrayio/array-io-keychain/wiki/Ho
7777
</div>
7878
</div>
7979
</div>
80-
<script src="https://cdn.jsdelivr.net/npm/keychain.js@0.0.5/dist/keychain.min.js"></script>
80+
<script src="https://cdn.jsdelivr.net/npm/keychain.js@0.0.6/dist/keychain.min.js"></script>
81+
<script src="https://cdn.jsdelivr.net/npm/keychain.js@0.0.6/dist/keychainWeb3.min.js"></script>
8182
<script src="https://cdn.jsdelivr.net/gh/ethereum/web3.js@1.0.0-beta.36/dist/web3.min.js" integrity="sha256-nWBTbvxhJgjslRyuAKJHK+XcZPlCnmIAAMixz6EefVk=" crossorigin="anonymous"></script>
8283
<script src="https://cdn.jsdelivr.net/gh/ethereumjs/browser-builds/dist/ethereumjs-tx/ethereumjs-tx-1.3.3.min.js"></script>
8384

@@ -86,7 +87,6 @@ <h6>Documentation: <a href="https://github.com/arrayio/array-io-keychain/wiki/Ho
8687

8788
window.onload = function () {
8889
let web3;
89-
const { Keychain, keychainWeb3 } = keychainjs;
9090
const keychain = new Keychain();
9191
keychain.ws.onclose = function() {
9292
document.body.style.backgroundColor = null;
@@ -102,15 +102,16 @@ <h6>Documentation: <a href="https://github.com/arrayio/array-io-keychain/wiki/Ho
102102
document.getElementById('btn_SIGN').addEventListener('click', function() {
103103
document.getElementById('etherscanLink').innerHTML = '';
104104
const endpoint = document.getElementById('input-endpoint').value;
105-
web3 = new Web3(new Web3.providers.HttpProvider(endpoint));
105+
web3 = new Web3(endpoint);
106+
const keychainWeb3 = new KeychainWeb3(keychain, web3);
106107
const toAddress = document.getElementById('input-to-address').value;
107108
const tx = { to: toAddress, value: 100, gas: 21000 };
108109
log(`Transaction to sign: ${JSON.stringify(tx)}`);
109110
log(`Select key from KeyChain`);
110111
keychain.method({ command: 'select_key' }).then (publicKey => {
111112
log(`Selected key: ${publicKey}`);
112113
log(`Signing the transaction with KeyChain`);
113-
return keychainWeb3.signTransaction.bind(web3)(tx, publicKey);
114+
return keychainWeb3.signTransaction(tx, publicKey);
114115
}).then( result => {
115116
log(`Result: ${JSON.stringify(result)}`);
116117
const rawHex = result.rawTransaction;

docs/index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,10 +319,9 @@
319319
</div>
320320

321321

322-
<script src="https://cdn.jsdelivr.net/npm/keychain.js@0.0.5/dist/keychain.min.js"></script>
322+
<script src="https://cdn.jsdelivr.net/npm/keychain.js@0.0.6/dist/keychain.min.js"></script>
323323
<script src="https://cdn.jsdelivr.net/gh/ethereumjs/browser-builds/dist/ethereumjs-tx/ethereumjs-tx-1.3.3.min.js"></script>
324324
<script>
325-
const { Keychain } = keychainjs;
326325
const keychain = new Keychain();
327326
keychain.command({command: 'version'}, function(data) {
328327
document.getElementById('version').innerText = data.result ? data.result : '';

0 commit comments

Comments
 (0)