Skip to content

Commit

Permalink
Update next version
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben-Rey committed Aug 30, 2024
1 parent 93668f8 commit 4206f59
Show file tree
Hide file tree
Showing 10 changed files with 803 additions and 1,273 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ ledger.json
yarn.lock
.vscode
screenshots/
.env

15 changes: 8 additions & 7 deletions fungible-token/front/react/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 43 additions & 4 deletions fungible-token/smart-contract/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion fungible-token/smart-contract/src/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getScByteCode } from './utils';

async function deploy() {
const account = await Account.fromEnv();
const provider = Web3Provider.newPublicBuildnetProvider(account);
const provider = Web3Provider.buildnet(account);

console.log('Deploying contract...');

Expand Down
15 changes: 8 additions & 7 deletions hello-world/front/react/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 31 additions & 23 deletions hello-world/front/react/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,29 @@ function App() {
return bytesToStr(result.value);
};

async function initProvider() {
const walletList = await getWallets();
const wallet = walletList.find(
(provider) => provider.name() === "MASSASTATION"
);
if (!wallet) {
console.log("No wallet found");
return;
}

const accounts = await wallet?.accounts();

if (accounts.length === 0) {
console.log("No accounts found");
return;
}

// We use the first account as the provider
const provider = accounts[0];
setProvider(provider);
}

useEffect(() => {
const initProvider = async () => {
const walletList = await getWallets();
const wallet = walletList.find(
(provider) => provider.name() === "MASSASTATION"
);
if (!wallet) {
console.log("No wallet found");
return;
}

// We get the accounts from the wallet
const accounts = await wallet?.accounts();

if (accounts.length === 0) {
console.log("No accounts found");
return;
}

// We use the first account as the provider
const provider = accounts[0];
setProvider(provider);
};
initProvider();
}, []);

Expand Down Expand Up @@ -85,7 +85,15 @@ function App() {
};

if (!provider) {
return <div className="app-container">Loading Provider...</div>;
return (
<div className="app-container">
<p>Loading Provider... </p>
<p>
Please install the Massa wallet and configure it for the Buildnet
network
</p>
</div>
);
}

return (
Expand Down
4 changes: 3 additions & 1 deletion hello-world/front/vanilla-js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ async function initProvider() {
(provider) => provider.name() === "MASSASTATION"
);
if (!wallet) {
throw new Error("No wallet found");
throw new Error(
"Wallet not detected. To proceed, please install the Massa wallet and configure it for the Buildnet network"
);
}

const accounts = await wallet.accounts();
Expand Down
17 changes: 9 additions & 8 deletions hello-world/front/vanilla-js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4206f59

Please sign in to comment.