Irys-xyz/arbundles

How do I get the transaction id of each content from bundles

Closed this issue · 1 comments

Hello, I have some problems, please help


const signer=new Arbundles.signers.ArweaveSigner(arkey)
const data=[
   await Arbundles.createData("Hello Elvin",signer,{tags:{name:'x',value:'1'}}),
   await Arbundles.createData("Hello Elvin2",signer,{tags:{name:'x',value:'2'}}),
  ]
const myBundle=await Arbundles.bundleAndSignData(data,signer);
const tx=await myBundle.toTransaction(arweave,arkey)
await arweave.transactions.sign(tx,arkey)
console.log(tx.id); //bundle txid
const x=await arweave.transactions.post(tx);

I uploaded two strings using the code above and check the transaction on viewblock.io
QQ截图20211206134700

Q1: How can I get the txid of each content (or each transaction) in the code? For example, the txid of the two strings in the demo, I need to access it through arweave.net/txid

Q2: When I use arweave-js to upload the same content, the display size is only 50B. Why does the content display 2.22KB after I upload it with arbundle (see picture), will it increase my cost?

Many thanks!

  1. myBundle.getIdBy(<item index>)