Skip to content

Commit

Permalink
feat: contractAddress shown for better UX
Browse files Browse the repository at this point in the history
  • Loading branch information
dianasavvatina committed Nov 21, 2024
1 parent 4636633 commit a43b2a4
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions dapps/tezos-provider/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
TezosSendResponse,
TezosSignResponse,
} from "./utils/tezos-provider";
import { ErrorObject } from '@walletconnect/utils';

const projectId = import.meta.env.VITE_PROJECT_ID;

Expand All @@ -23,6 +24,7 @@ const App = () => {
| TezosSendResponse
| TezosSignResponse
| TezosGetAccountResponse
| ErrorObject
| string
| string[]
| null
Expand Down Expand Up @@ -122,6 +124,8 @@ const App = () => {
await provider.signer.disconnect();
setIsConnected(false);
setResult(null);
setBalance("");
setContractAddress("[click Origination to get contract address]");
} catch (error) {
console.error("Error disconnecting from Tezos:", error);
}
Expand Down Expand Up @@ -161,7 +165,7 @@ const App = () => {
res = await provider.tezosSendOrigination(
SAMPLES[SAMPLE_KINDS.SEND_ORGINATION],
);
for (let attempt = 0; attempt < 5; attempt++) {
for (let attempt = 0; attempt < 10; attempt++) {
const contractAddressList = await provider.getContractAddress(
res.hash,
);
Expand Down Expand Up @@ -220,7 +224,7 @@ const App = () => {
setResult([error.name, error.message]);
} else {
console.error(`Error sending ${kind}:`, error);
setResult(JSON.stringify(error, null, 2));
setResult(error as ErrorObject);
}
}
},
Expand Down Expand Up @@ -283,6 +287,10 @@ const App = () => {
<b>Balance: </b>
{balance}
</p>
<p>
<b>Contract address: </b>
{contractAddress}
</p>
<div className="layout-container">
<div className="btn-container">
<button onClick={disconnect} onMouseEnter={describeClear}>
Expand Down

0 comments on commit a43b2a4

Please sign in to comment.