-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDAppHero_Example.html
More file actions
171 lines (163 loc) · 5.29 KB
/
DAppHero_Example.html
File metadata and controls
171 lines (163 loc) · 5.29 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<!DOCTYPE html>
<html lang="en">
<head>
<title>DappHero HTML Generation</title>
<meta charset="UTF-8" />
<meta name="author" content="DappHero" />
<meta name="description" content="DappHero" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
</head>
<body>
<header>
<nav>
<img
alt="Logo"
src="//s3.amazonaws.com/appforest_uf/f1580782353653x261239071988881950/noun_Sandwich_3059105.png"
height="70"
/>
</nav>
<h1>NamChain's Test DApp in DAppHero</h1>
<p>
<mark
>Powered by <a href="https://www.dapphero.io">DappHero.io</a></mark
>
</p>
<p>NamChain's DappHero Example</p>
<br />
<p>
<button data-dh-feature="network" data-dh-property-enable="true">
Enable Web3
</button>
</p>
</header>
<div>
<section><h2>test</h2></section>
<header>
<section>
<section><h2>Public Methods</h2></section>
<header>
<div
data-dh-feature="customContract"
data-dh-property-method-id="tMyt"
data-dh-property-auto-invoke="true"
data-dh-property-contract-name="test"
data-dh-property-method-name="retreive"
>
<h3>Method <mark>"retreive"</mark></h3>
<section>
<aside>
<div
data-dh-property-method-id="tMyt"
data-dh-property-outputs="true"
>
<pre>Output...</pre>
</div>
<button
data-dh-property-invoke="true"
data-dh-property-method-id="tMyt"
>
retreive
</button>
</aside>
</section>
</div>
</header>
</section>
</header>
<header>
<section>
<section><h2>Transaction Methods</h2></section>
<header>
<div
data-dh-feature="customContract"
data-dh-property-method-id="uluB"
data-dh-property-auto-invoke="false"
data-dh-property-contract-name="test"
data-dh-property-method-name="store"
>
<h3>Method <mark>"store"</mark></h3>
<section>
<aside>
<section>
Input name: <i>num</i>
<input
type="text"
placeholder="uint256"
data-dh-property-method-id="uluB"
data-dh-property-input-name="num"
/>
</section>
<section>
Input name: <i>m1</i>
<input
type="text"
placeholder="uint256"
data-dh-property-method-id="uluB"
data-dh-property-input-name="m1"
/>
</section>
<section>
Input name: <i>m2</i>
<input
type="text"
placeholder="uint256"
data-dh-property-method-id="uluB"
data-dh-property-input-name="m2"
/>
</section>
<section>
Input name: <i>m3</i>
<input
type="text"
placeholder="uint256"
data-dh-property-method-id="uluB"
data-dh-property-input-name="m3"
/>
</section>
<button
data-dh-property-invoke="true"
data-dh-property-method-id="uluB"
>
store
</button>
</aside>
</section>
</div>
</header>
</section>
</header>
</div>
<script
id="dh-apiKey"
data-api="1591083663771x741938777566740500"
src="https://package.dapphero.io/main.js"
></script>
<link rel="stylesheet" href="https://unpkg.com/mvp.css" />
<style>
form {
margin: 40px;
}
</style>
<script>
document.addEventListener(
"dappHeroConfigLoaded",
({ detail: dappHero }) => {
// Inside here you can listen to any event you want
console.log("DappHero Has Loaded!");
// For projects with auto-invoked method, you will want to filter on events
// dappHero.listenToTransactionStatusChange(data => {
// console.log("Listening to transtaction status change", data);
// });
// This is how you can listen to any events your smart contract emits
dappHero.listenToSmartContractBlockchainEvent((data) => {
console.log("The blockChain Events: ", data);
});
//This is an example method for alerting your users they are on the wrong network
//if(window.dappHero.provider.chainId !== 3){
// alert("Wrong network! You should be on ropsten")
//}
}
);
</script>
</body>
</html>