solang icon indicating copy to clipboard operation
solang copied to clipboard

Transaction signature

Open Abhishek-1857 opened this issue 3 years ago • 5 comments

How can i get the transaction hash or signature for the function im calling of the solidity contract for solana

Libraries im using is solana web3 and solana solana solidity

here's the code : const contract = new Contract(connection, program.publicKey, storage.publicKey, ERC20_ABI, payer)
const to="xyz" const transaction =await contract.functions.burnSolana2Gxt(to, 1) console.log(transaction.hash); // or anything for getting signature or hash

Abhishek-1857 avatar Sep 09 '22 06:09 Abhishek-1857

Any idea on how to get transaction signature for contract function written in solidity

Abhishek1857 avatar Sep 20 '22 06:09 Abhishek1857

Hi there! How is this issue related to solang? Are you only unable to get the transaction hash for Contracts compiled with solang, or in general?

xermicus avatar Sep 20 '22 08:09 xermicus

The @solana/solidity library does not return the transaction signature. I've added this here: https://github.com/solana-labs/solana-solidity.js/pull/39

Let me know what you think @Abhishek-1857

seanyoung avatar Sep 20 '22 09:09 seanyoung

Yes its related to solang. Yes i can't get the hash for contracts compiled with solang and the contract is written in solidity

Abhishek1857 avatar Sep 20 '22 10:09 Abhishek1857

@Abhishek1857 this should be resolved now. For now this requires using @solana/solidity from git: https://github.com/solana-labs/solana-solidity.js/pull/39

Please let us know if this works for you, thanks

seanyoung avatar Sep 23 '22 08:09 seanyoung