Skip to content

Commit

Permalink
bal call
Browse files Browse the repository at this point in the history
  • Loading branch information
TheChronicMonster committed Sep 16, 2022
1 parent 3c5b1b3 commit b233a94
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/simple-nft-minter/index.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { loadStdlib } from '@reach-sh/stdlib';
const stdlib = loadStdlib(process.env);

const startingBalance = stdlib.parseCurrency(100000);
const startingBalance = stdlib.parseCurrency(1000);

const [minter, receiver] = await stdlib.newTestAccounts(2, startingBalance);

Expand All @@ -26,9 +26,9 @@ console.log(`Minter starting balance: ${bal}.`);

console.log(`Creating the NFT`);
const theNFT = await stdlib.launchToken(minter, "nftName", "SYM", { supply: 1, url: "https://reach.sh", clawback: null, freeze: null, defaultFrozen: false, reserve: null, note: Uint8Array[1]});
const nftId = theNFT.id;
const nftId = await theNFT.id;

const [preAmtNFT] = await stdlib.balancesOf(minter, [nftId]);
const preAmtNFT = await minter.balanceOf(nftId);
console.log(`Minter has ${preAmtNFT} of the NFT`);

if (stdlib.connector == 'ALGO' && await receiver.tokenAccept(nftId)) {console.log(`Receiver opted-in to NFT`)};
Expand All @@ -39,5 +39,5 @@ console.log(`NFT transfer made from minter to receiver`);
const postBal = await getBal(minter);
console.log(`Minter balance after transfer: ${postBal}.`);

const [postAmtNFT] = await stdlib.balancesOf(receiver, [nftId]);
const postAmtNFT = await receiver.balanceOf(nftId);
console.log(`Receiver has ${postAmtNFT} of the NFT`);

0 comments on commit b233a94

Please sign in to comment.