@@ -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 ;
0 commit comments