#How to work with Auro Wallet + Lightnet

13 messages · Page 1 of 1 (latest)

meager gale
#

I've added a new chain with Lighnet graphql url to the Auro Wallet.

Then I use this script to send some funds to my Auro Wallet

import { AccountUpdate, Lightnet, Mina, PublicKey, UInt64 } from 'o1js';

// Network configuration
const network = Mina.Network({
  mina: 'http://127.0.0.1:8080/graphql',
  archive: 'http://127.0.0.1:8282',
  lightnetAccountManager: 'http://127.0.0.1:8181',
});
Mina.setActiveInstance(network);

// Fee payer setup
const senderPrivateKey = (await Lightnet.acquireKeyPair()).privateKey;
const senderPublicKey = senderPrivateKey.toPublicKey();

// Release previously acquired key pair
const keyPairReleaseMessage = await Lightnet.releaseKeyPair({
  publicKey: senderPublicKey.toBase58(),
});

if (keyPairReleaseMessage) console.log(keyPairReleaseMessage);

const senderUpdate = AccountUpdate.createSigned(senderPublicKey);

const tx = await Mina.transaction(
  {
    sender: senderPublicKey,
    fee: 100000000,
  },
  async () => {
    senderUpdate.send({
      to: PublicKey.fromBase58(
        MY_PUBLIC_ADDRESS
      ),
      amount: 1000000000000000000,
    });
  }
);

await tx.prove();
await tx.sign([senderPrivateKey]);

let pendingTx = await tx.send();
console.log(`Got pending transaction with hash ${pendingTx.hash}`);

// wait until transaction is included in a block
await pendingTx.wait();

console.log(
  `Transaction included in block!`
);

However, the balance in my Auro Wallet still zero for the Lightnet. Is something wrong?

languid frigate
#

Have you added Lighnet's IP to the custom GQL node of Auro Wallet?

#

Because Auro will use current network to request balance to do a balance check

meager gale
#

I just added in this screen

barren kestrel
meager gale
barren kestrel
#

odd, works for me

meager gale
#

@barren kestrel, how did you transfer the funds?

languid frigate
barren kestrel
meager gale