You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The goal of this contract is managing an NFT mint where the mint is paid in native currency but the cost of one NFT is always 100$.
3
+
The example contract is deployed at : `0x19f8503273cdb5aa93ffe4539277684615242127aa2e65ef91424136a316c9c7`
4
+
5
+
The goal of this contract is managing an NFT mint where the mint is paid in native currency but the cost of one NFT is always 1$.
4
6
This example is intended to be run on Aptos testnet because it depends on Pyth and Wormhole existing onchain.
5
7
6
8
### Important files :
@@ -12,13 +14,13 @@ Both combined contain the key pieces of code needed to make an Aptos fullstack a
12
14
13
15
- Use `aptos init` with rest_url : `https://testnet.aptoslabs.com/` and faucet `https://faucet.testnet.aptoslabs.com` to generate a new keypair.
14
16
- Use a faucet to airdrop testnet APT to your newly created account by calling `aptos account fund-with-faucet --account default`. If this doesn't work, I have had success importing my private key from `.aptos/config.yaml` into Petra and clicking the airdrop button. Otherwise send APT from another account.
15
-
- Get your account address from `.aptos/config.yaml` and replace `mint_nft="_"` by `mint_nft="<ADDRESS>"` in `Move.toml`
17
+
- Get your account address from `.aptos/config.yaml` and replace `mint_nft="0x19f8503273cdb5aa93ffe4539277684615242127aa2e65ef91424136a316c9c7"` by `mint_nft="<ADDRESS>"` in `Move.toml`
16
18
-`aptos move compile`
17
19
-`aptos move publish`
18
20
19
21
### How to run the webapp :
20
22
21
-
- In `app/src/App.tsx` replace `const MINT_NFT_MODULE = "_"` by `const MINT_NFT_MODULE = "<ADDRESS>"` the address of your module from above.
23
+
- In `app/src/App.tsx` replace `const MINT_NFT_MODULE = "0x19f8503273cdb5aa93ffe4539277684615242127aa2e65ef91424136a316c9c7"` by `const MINT_NFT_MODULE = "<ADDRESS>"` the address of your module from above.
22
24
-`npm install`
23
25
-`npm run start`
24
26
- Go to `http://localhost:3000/` in your browser and use Petra wallet to transact with the app.
// Please read https://docs.pyth.network/consume-data before building on Pyth
@@ -16,11 +15,11 @@ const testnetConnection = new AptosPriceServiceConnection(
16
15
);// Price service client used to retrieve the offchain VAAs to update the onchain price
17
16
18
17
// Price id : this is not an aptos account but instead an opaque identifier for each price https://pyth.network/developers/price-feed-ids/#pyth-cross-chain-testnet
// Subscribe to offchain prices. These are the prices that a typical frontend will want to show.
70
69
testnetConnection.subscribePriceFeedUpdates(
71
-
[ETH_USD_TESTNET_PRICE_ID],
70
+
[APT_USD_TESTNET_PRICE_ID],
72
71
(priceFeed: PriceFeed)=>{
73
72
constprice=priceFeed.getPriceUnchecked();// Fine to use unchecked (not checking for staleness) because this must be a recent price given that it comes from a websocket subscription.
0 commit comments