|
|
|
|
|
|
|
|
PERMISSION_REQUEST_SUCCESS = "Wallet is connected" |
|
|
PERMISSION_REQUEST_SUCCESS = "Wallet is connected" |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const App = () => { |
|
|
|
|
|
|
|
|
interface AppProps { |
|
|
|
|
|
fa2Contract: string, |
|
|
|
|
|
swapContract: string, |
|
|
|
|
|
receiver: string, |
|
|
|
|
|
amount: number |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const App = ({ |
|
|
|
|
|
fa2Contract, |
|
|
|
|
|
swapContract, |
|
|
|
|
|
receiver, |
|
|
|
|
|
amount |
|
|
|
|
|
}: AppProps) => { |
|
|
const [Tezos, setTezos] = useState<TezosToolkit>( |
|
|
const [Tezos, setTezos] = useState<TezosToolkit>( |
|
|
new TezosToolkit("https://mainnet.api.tez.ie/") |
|
|
new TezosToolkit("https://mainnet.api.tez.ie/") |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
} else if (userAddress && !isNaN(userBalance)) { |
|
|
} else if (userAddress && !isNaN(userBalance)) { |
|
|
return ( |
|
|
return ( |
|
|
<div className="main-box"> |
|
|
<div className="main-box"> |
|
|
<h1>Taquito Boilerplate</h1> |
|
|
|
|
|
|
|
|
|
|
|
<div id="tabs"> |
|
|
<div id="tabs"> |
|
|
<div |
|
|
<div |
|
|
id="transfer" |
|
|
id="transfer" |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div id="dialog"> |
|
|
<div id="dialog"> |
|
|
<div id="content"> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p> |
|
|
|
|
|
<i className="far fa-address-card"></i> {userAddress} |
|
|
|
|
|
</p> |
|
|
|
|
|
<p> |
|
|
|
|
|
<i className="fas fa-piggy-bank"></i> |
|
|
|
|
|
{(userBalance / 1000000).toLocaleString("en-US")} ꜩ |
|
|
|
|
|
</p> |
|
|
|
|
|
</div> |
|
|
|
|
|
<BuyButton |
|
|
<BuyButton |
|
|
Tezos={Tezos} |
|
|
Tezos={Tezos} |
|
|
sender={userAddress} |
|
|
sender={userAddress} |
|
|
FA2address="KT1BB1uMwVvJ1M3vVHXWALs1RWdgTp1rnXTR" |
|
|
|
|
|
receiver="tz1hJncvXvL2VyctPE685GJPXDaRJ7dtiwjm" |
|
|
|
|
|
amount={100} |
|
|
|
|
|
|
|
|
FA2address={fa2Contract} |
|
|
|
|
|
receiver={receiver} |
|
|
|
|
|
amount={amount} |
|
|
/> |
|
|
/> |
|
|
<DisconnectButton |
|
|
<DisconnectButton |
|
|
wallet={wallet} |
|
|
wallet={wallet} |
|
|
|
|
|
|
|
|
} else if (!publicToken && !userAddress && !userBalance) { |
|
|
} else if (!publicToken && !userAddress && !userBalance) { |
|
|
return ( |
|
|
return ( |
|
|
<div className="main-box"> |
|
|
<div className="main-box"> |
|
|
<div className="title"> |
|
|
|
|
|
<h1>Taquito Boilerplate</h1> |
|
|
|
|
|
|
|
|
|
|
|
<a href="https://app.netlify.com/start/deploy?repository=https://github.com/ecadlabs/taquito-boilerplate"> |
|
|
|
|
|
<img |
|
|
|
|
|
src="https://www.netlify.com/img/deploy/button.svg" |
|
|
|
|
|
alt="netlify-button" |
|
|
|
|
|
/> |
|
|
|
|
|
</a> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div id="dialog"> |
|
|
<div id="dialog"> |
|
|
<header>Welcome to Taquito Boilerplate App!</header> |
|
|
|
|
|
<div id="content"> |
|
|
|
|
|
<p>Hello!</p> |
|
|
|
|
|
<p> |
|
|
|
|
|
This is a template Tezos dApp built using Taquito. It's a starting |
|
|
|
|
|
point for you to hack on and build your own dApp for Tezos. |
|
|
|
|
|
<br /> |
|
|
|
|
|
If you have not done so already, go to the{" "} |
|
|
|
|
|
<a |
|
|
|
|
|
href="https://github.com/ecadlabs/taquito-boilerplate" |
|
|
|
|
|
target="_blank" |
|
|
|
|
|
rel="noopener noreferrer" |
|
|
|
|
|
> |
|
|
|
|
|
Taquito boilerplate Github page |
|
|
|
|
|
</a>{" "} |
|
|
|
|
|
and click the <em>"Use this template"</em> button. |
|
|
|
|
|
</p> |
|
|
|
|
|
<p>Go forth and Tezos!</p> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<ConnectButton |
|
|
<ConnectButton |
|
|
Tezos={Tezos} |
|
|
Tezos={Tezos} |
|
|
setContract={setContract} |
|
|
setContract={setContract} |