-
Notifications
You must be signed in to change notification settings - Fork 194
/
bundle.js
61 lines (51 loc) · 1.85 KB
/
bundle.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
// Add imports here
// Add functions here
/*
Do not edit code below this line.
*/
var mnemonicVue = new Vue({
el:"#app",
data: {
mnemonic: "",
privKey: "",
pubKey: "",
ETHaddress: "",
sampleTransaction: {
nonce: '0x00',
gasPrice: '0x09184e72a000',
gasLimit: '0x2710',
to: '0x31c1c0fec59ceb9cbe6ec474c31c1dc5b66555b6',
value: '0x10',
data: '0x7f7465737432000000000000000000000000000000000000000000000000000000600057',
chainId: 3
},
signedSample: {},
recoveredAddress: ""
},
methods:{
generateNew: function(){
this.mnemonic = generateMnemonic()
},
signSampleTx: function(){
this.signedSample = signTx(this.privKey, this.sampleTransaction)
console.log("signed Sample", this.signedSample)
}
},
watch: {
mnemonic: function(val){
this.privKey = generatePrivKey(val)
},
privKey: function(val){
this.pubKey = derivePubKey(val)
},
pubKey: function(val){
this.ETHaddress = deriveEthAddress(val)
this.recoveredAddress = ""
},
signedSample: function(val){
this.recoveredAddress = getSignerAddress(val)
}
}
})
},{}]},{},[1]);