@@ -10,6 +10,7 @@ import {
10
10
TezosSendResponse ,
11
11
TezosSignResponse ,
12
12
} from "./utils/tezos-provider" ;
13
+ import { ErrorObject } from '@walletconnect/utils' ;
13
14
14
15
const projectId = import . meta. env . VITE_PROJECT_ID ;
15
16
@@ -23,6 +24,7 @@ const App = () => {
23
24
| TezosSendResponse
24
25
| TezosSignResponse
25
26
| TezosGetAccountResponse
27
+ | ErrorObject
26
28
| string
27
29
| string [ ]
28
30
| null
@@ -122,6 +124,8 @@ const App = () => {
122
124
await provider . signer . disconnect ( ) ;
123
125
setIsConnected ( false ) ;
124
126
setResult ( null ) ;
127
+ setBalance ( "" ) ;
128
+ setContractAddress ( "[click Origination to get contract address]" ) ;
125
129
} catch ( error ) {
126
130
console . error ( "Error disconnecting from Tezos:" , error ) ;
127
131
}
@@ -161,7 +165,7 @@ const App = () => {
161
165
res = await provider . tezosSendOrigination (
162
166
SAMPLES [ SAMPLE_KINDS . SEND_ORGINATION ] ,
163
167
) ;
164
- for ( let attempt = 0 ; attempt < 5 ; attempt ++ ) {
168
+ for ( let attempt = 0 ; attempt < 10 ; attempt ++ ) {
165
169
const contractAddressList = await provider . getContractAddress (
166
170
res . hash ,
167
171
) ;
@@ -220,7 +224,7 @@ const App = () => {
220
224
setResult ( [ error . name , error . message ] ) ;
221
225
} else {
222
226
console . error ( `Error sending ${ kind } :` , error ) ;
223
- setResult ( JSON . stringify ( error , null , 2 ) ) ;
227
+ setResult ( error as ErrorObject ) ;
224
228
}
225
229
}
226
230
} ,
@@ -283,6 +287,10 @@ const App = () => {
283
287
< b > Balance: </ b >
284
288
{ balance }
285
289
</ p >
290
+ < p >
291
+ < b > Contract address: </ b >
292
+ { contractAddress }
293
+ </ p >
286
294
< div className = "layout-container" >
287
295
< div className = "btn-container" >
288
296
< button onClick = { disconnect } onMouseEnter = { describeClear } >
0 commit comments