Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update next version #312

Merged
merged 1 commit into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading