Skip to content

Commit eccd10b

Browse files
authored
Update for devnet (#55)
* `linera-protocol`: bump to `devnet_2025_06_27` * Update examples for devnet * `examples/hosted-fungible`: support Ethereum-style account owners * `.env`: update app IDs for new devnet * `examples/hosted-counter-metamask`: update signer API * `hosted-fungible`: check balance before requesting notifications
1 parent 9cb72b3 commit eccd10b

File tree

6 files changed

+163
-11
lines changed

6 files changed

+163
-11
lines changed

.env

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
VITE_FAUCET_URL=https://faucet.testnet-babbage.linera.net
2-
VITE_COUNTER_APP_ID=
3-
VITE_FUNGIBLE_APP_ID=
1+
VITE_FAUCET_URL=https://faucet.devnet-2025-06-27.linera.net/
2+
VITE_FUNGIBLE_APP_ID=bca9f0d106dadea4d7e879a729a3882a2c094ef1a0300596f64c5ce640f8cf10
3+
VITE_COUNTER_APP_ID=ef1977bfc2291069044a0650c73895d1ef8f8b1a850a5d8320c8da50b0c083c3
4+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../.env

examples/hosted-counter-metamask/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ <h2>Chain history for <code id="chain-id" class="hex">requesting chain…</code>
6666
async function run() {
6767
await linera.default();
6868
const faucet = await new linera.Faucet(import.meta.env.VITE_FAUCET_URL);
69-
const signer = await new linera_signer.MetaMaskEIP191Signer();
69+
const signer = await new linera_signer.MetaMask();
7070
const wallet = await faucet.createWallet();
7171
const owner = await signer.address();
7272
document.getElementById('owner').innerText = owner;

examples/hosted-fungible/index.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ <h2>Chain history for <code id="chain-id" class="hex">requesting a new microchai
163163
const response = JSON.parse(await application.query(gql(`query { tickerSymbol, accounts { entries { key value } } }`)));
164164
console.debug('application response:', response);
165165
document.querySelector('#ticker-symbol').textContent = response.data.tickerSymbol;
166-
document.querySelector('#balance').textContent = (+(response?.data?.accounts?.entries?.[0] || 0)).toFixed(2);
166+
document.querySelector('#balance').textContent = (+(response?.data?.accounts?.entries?.[0]?.value || 0)).toFixed(2);
167167
}
168168

169169
async function transfer(application, donor, amount, recipient) {
@@ -174,7 +174,7 @@ <h2>Chain history for <code id="chain-id" class="hex">requesting a new microchai
174174

175175
let errors = [];
176176
try {
177-
const match = recipient.match(/^(0x[0-9a-f]{64})@([0-9a-f]{64})$/);
177+
const match = recipient.match(/^(0x[0-9a-f]{40})@([0-9a-f]{64})$/);
178178
if (!match) throw new Error('Invalid recipient address: expected `owner@chain_id`');
179179

180180
const query = gql(`mutation(
@@ -232,6 +232,8 @@ <h2>Chain history for <code id="chain-id" class="hex">requesting a new microchai
232232

233233
const application = await client.frontend().application(FUNGIBLE_APP_ID);
234234

235+
await updateBalance(application);
236+
235237
client.onNotification(notification => {
236238
let newBlock = notification.reason.NewBlock;
237239
if (!newBlock) return;

linera-protocol

Submodule linera-protocol updated 62 files

0 commit comments

Comments
 (0)