Questions tagged [hedera-hashgraph]
Questions related to development on Hedera Hashgraph distributed ledger
131
questions
1
vote
1
answer
33
views
Deploying Solidity smart contract on Hedera Hashgraph
Hi Everyone I have write smart contract for ERC-20 and deploy it to ethereum network. Can I use the same smart contract to deploy Hedera network with out any code change. So I can use by existing ...
0
votes
1
answer
23
views
how can I force a query to Hedera to be directed to a mirror node?
When I call a smart contract view function on the Hedera Testnet, I have to pay in HBAR for the response. My understanding is that Queries should go to mirror nodes but in my case this does not happen....
0
votes
0
answers
29
views
I am deploying smart contract of 23 kb on Hedera Previewnet, But it gives error "HardhatError: HH110: Invalid JSON-RPC response received"
I am having an issue in deploying the smart contract with a size of 23.4 kb on Hedera Preview net using hardhat.
Below is the error
HardhatError: HH110: Invalid JSON-RPC response received:
502 Server ...
2
votes
1
answer
29
views
How to Associate/Dissociate an HTS token using Hashgraph JS SDK
I have created a new token on HTS using the JavaScript SDK:
// Create an HTS Fungible Token
async function createFungibleToken(
client,
treasuryAccountId,
treasuryAccountPrivateKey,
) {
// ...
2
votes
1
answer
37
views
How to check if an account is associated with an HTS token using the Hashgraph JS SDK
Using the SDK, I was able to obtain a “TokenBalanceMap” using the following code:
const accountBalance = await new AccountBalanceQuery()
.setAccountId(accountId)
.setTokenIds([tokenId])
.execute(...
6
votes
1
answer
67
views
How do you Associate/Dissociate an HTS token using EVM transaction?
Before I can receive an HTS token I need to first associate with the token ID.
If I were using the JS SDK I know to do the following where the accountId is the account that I want to associate with ...
6
votes
1
answer
47
views
Is it possible to create an account on Hedera that has both Ed25519 keys and ECDSA keys?
When visiting the Hedera portal,
it generates 2 sets of keys for me:
an ED25519 key and an ECDSA key.
However, these correspond to different accounts.
I would like to be able to operate a single ...
2
votes
2
answers
47
views
Hedera removes the contract after deployment
I am trying to deploy a contract. I get the contract address without errors. Immediately after deploy, the contract is deleted. Although it is possible to transfer funds to the contract address ...
0
votes
0
answers
14
views
how can I integrate hedara hashgraph and flutter?
I want to create Mobile Dapp . I want to build the front end through dart Flutter . How can I integrate it wiith the Hedara hashgraph?
I couldnt find any resource for this online.
I could have gone ...
5
votes
2
answers
95
views
How to convert a Hedera native address into a non-long-zero EVM address?
Using Hedera SDK JS, I can convert an Account ID to "long-zero" format EVM address.
e.g. 0.0.3996280 --> 0x00000000000000000000000000000000003cfa78
(See related question: "How to ...
4
votes
1
answer
63
views
How to get updated remaining HTS fungible token allowance on Hedera?
I have a DApp with a contract that has an approved allowance to spend HTS fungible tokens on behalf of a user. However, the contract keeps reverting with SPENDER_DOES_NOT_HAVE_ALLOWANCE error.
I have ...
0
votes
1
answer
19
views
How can I encode and decode an image for use with the Hedera file service?
I want to store images on the Hedera file service but I have no idea on how to get started. I don't know how I should encode my image and how to decode it. The documentation is extremely vague and ...
4
votes
1
answer
418
views
Golang hedera sdk testnet "Client received GoAway with error code ..."
I am trying to connect to hedera test net. I followed the docs and created a account and used
hederaClient := hederaSdk.ClientForTestnet()
hederaClient.SetOperator(cfg.Hedera.OperatorID, cfg.Hedera....
1
vote
0
answers
19
views
How far into the future can a transaction be scheduled with `scheduled transaction`
in the documentation about the scheduled transaction there is no mention as to the limit (if any) to the value of the expirationTime parameter.
I have two questions:
what is the maximum value for the ...
1
vote
0
answers
26
views
Hedera transfer token between accounts - recipent paying transaction fees
I want to transfer tokens (fungible) from account A to account B, but I want the transaction to be submitted by account B and consequently account B pays the transaction fees.
Is this possible in ...
1
vote
1
answer
48
views
Error when trying to compile my solidity smart contract using hardhat.config.js on hedera network using Arkhia JSON-RPC relay
HardhatError: HH8: There's one or more errors in your config file:
Invalid account: #0 for network: hedera - private key too short, expected 32 bytes
I keep getting this error when I use the DER ...
2
votes
1
answer
45
views
What is a Delegate Contract ID in Hedera
The concept of Delegate Contract ID is touched upon in the documentation but I don't understand it.
I was not able to find examples or further explanations. Can someone point me to more details?
2
votes
0
answers
24
views
Hedera Rust SDK unable to encoded transaction
Hy everyone, I am trying to create freeze TransferTrasnaction using Rust SDK. I now it's still in development process but I was wondering if there is a way. What I want to do is create transaction on ...
1
vote
1
answer
24
views
Submit Token and Smart Contract related Transactions on UI and listen on Server
What set up do I need for submitting transactions on client,
but listen for execution on the server like a webhook?
I want to listen on server to change status of records in my own database.
Do I need ...
1
vote
0
answers
73
views
Hedera chain Unable to connect to Network using @hashgraph/sdk
Im following the official documentation and trying to play around wit Hedera Chain, I'm not able to execute any query it just gives timeOut error.
//Verify the account balance
const client = ...
1
vote
0
answers
50
views
How do i create Account on hedera testnet?
I am having issues creating account on Hedera testnet. below is the error message
C:\Users\OJI\Documents\Hedera-test\node_modules@hashgraph\sdk\lib\Executable.cjs:666
throw new Error(max attempts of $...
2
votes
1
answer
22
views
Can I control which consensus node I want to submit my transaction to from the client?
I'm using Javascript SDK. Currently it seems random. I'm wanting to submit to a specific node to reduce latency
4
votes
1
answer
85
views
Why does `eth_estimateGas` on Hedera return an unexpectedly high value?
I am aware that eth_estimateGas is not intended to be exact,
but currently, I'm getting actual gasUsed values
that are approximately 6% of the value returned by eth_estimateGas.
In the following ...
2
votes
1
answer
64
views
Large discrepancy in `gasUsed` values in near-identical transactions on Hedera - why?
I have noticed that there is a discrepancy between the amount of gas used
by a transaction is almost identical:
I'm making a call to a smart contract,
with the same parameters twice in a row,
and the ...
3
votes
1
answer
121
views
How can I use a transaction hash from Hashscan in a JSON-RPC query, on Hedera?
I'm looking at a transaction on Hashscan
Its transaction hash is:
0x89eb7e219df6f8b3b3406c8a3698d5b484a4945059af643861c878e41ffc161b2589cc82ff40b4392ceb53856c5252c1
... which does not work with the ...
1
vote
1
answer
87
views
How can I obtain a block number programmatically on Hedera?
I understand from HIP-415: Introduction Of Blocks,
that Hedera now has blocks,
and they're based on timestamps of the transactions
being grouped together into "record files"
which are an ...
2
votes
1
answer
262
views
How to convert a Hedera native address into an EVM address?
How can I convert a Hedera-native address to an EVM address (and vice versa)?
Let's say I have the following:
a Hedera-native account, with an address like 0.0.12345
an EVM account on Hedera, with ...
1
vote
3
answers
196
views
How can I connect to Hedera Testnet using web3.js or ethers.js?
I would like to interact with the Hedera Testnet using web3.js or ethers.js. How can I do this?
I have previously interacted with Hedera Testnet using hedera-sdk-js,
for example using the ...
3
votes
1
answer
210
views
How can I connect to Hedera Testnet over RPC?
I am unable to connect to a Hedera Testnet RPC endpoints over HTTP,
reliably, I get the following "Unknown error" intermittently:
[Request ID: fe7b9928-a23f-0d72-61a1-b7cd23658c01] Unknown ...
3
votes
1
answer
80
views
How to get the HBAR balance of an account on Hedera at a specific time in the past?
I can query the current balance from the mirror node using this request:
curl --request GET \
'https://testnet.mirrornode.hedera.com/api/v1/balances?account.id=0.0.3996280' \
--header 'Content-...
1
vote
0
answers
111
views
"Unkown error: Receipt Status Error" for a Smart Contract deployed on Hedera
I'm following this Hedera tutorial for transferring hbars with a smart contract.
After trying to run the code provided in the tutorial, I get the following error:
ReceiptStatusError: receipt for ...
1
vote
2
answers
78
views
What is the "full unit" of the native coin (HBAR) on Hedera?
In my smart contract, I would like to accept exactly 1 full HBAR unit in a payable function.
The following code would work in Ethereum, by specifying 1 ether.
pragma solidity 0.8.18;
contract Example ...
4
votes
1
answer
976
views
How to resolve intermittent "nonce has already been used" error when deploying multiple smart contracts to Hedera Testnet?
When I deploy 2 smart contracts at the same time to Hedera Testnet,
I get the following error:
nonce has already been used [ See: https://links.ethers.org/v5-errors-NONCE_EXPIRED ]
This occurs ...
4
votes
1
answer
111
views
When running "hedera-json-rpc-relay", how to configure a connection to Hedera Testnet?
I'm following the instructions on hedera-json-rpc-relay:
Specifically docs/configuration.md,
attempting to run the RPC relay connecting to Hedera Testnet:
HEDERA_NETWORK=TESTNET
OPERATOR_ID_MAIN=0.0....
1
vote
1
answer
118
views
How do I configure "hedera-local-node" to to connect to hedera testnet?
I'm trying to run a Hedera local node locally,
and I'm following the docker set up instructions
followed by these instructions to set up a localhost network,
but then hoping to change the connection ...
0
votes
0
answers
30
views
How to send a payment request on Hedera with a recipient address and an amount?
I hope you are doing well. Can someone advise me on the best method to send a payment request on Hedera with a recipient address and an amount? I am trying to create a QR code for a web app that can ...
1
vote
0
answers
38
views
How do I query a transaction receipt and confirm that the transaction is executed successfully on Hedera network?
I have a completed transaction and I have its transaction ID. I am trying to query that transaction using the following code:
const transactionQueryExecuteTx = await new TransactionReceiptQuery()
...
1
vote
0
answers
125
views
I am getting an error when trying to sign a transaction using HashPack with Hedera Javascript SDK
I am attempting to sign a transaction on the front end and send the signed bytes to the backend for transaction execution. However, I am encountering difficulty in signing the transaction. I have ...
0
votes
0
answers
41
views
How to get "Request ID" for hedera transactions that are not errors?
When sending transactions using ethers.js to the Hedera testnet,
and one errors, I can catch it like so:
} catch (error) {
if (error instanceof Error) console.log(error.message);
...
0
votes
0
answers
14
views
How do I query transactions receipts from the mirror using SDK?
I've got this code.
const client = Client.forTestnet().setOperator(operatorId, operatorKey)
const recipt = new TransactionReceiptQuery()
.setTransactionId(transactionId)
.execute(client)
...
1
vote
1
answer
56
views
How do I send a transaction to HashPack for signing?
I am trying to sign a transaction on the frontend and send the signed bytes to the backend to execute the transaction. However, I am having difficulty signing the transaction. I have a HashConnect ...
1
vote
2
answers
123
views
INVALID_FULL_PREFIX_SIGNATURE_FOR_PRECOMPILE error when trying to create a token on Hedera via a smart contract
I am encountering an error message INVALID_FULL_PREFIX_SIGNATURE_FOR_PRECOMPILE while attempting to create a Hedera Token through a smart contract.
The function in question is designed to call the ...
0
votes
1
answer
66
views
I am getting error message SPENDER_DOES_NOT_HAVE_ALLOWANCE while attempting to transfer HTS tokens via a smart contract
I am encountering an error message SPENDER_DOES_NOT_HAVE_ALLOWANCE while attempting to transfer HTS tokens from my wallet using a smart contract. Although I deployed my smart contract some time ago on ...
0
votes
1
answer
51
views
I am getting an INSUFFICIENT_TX_FEE error when trying to call a Solidity function that mints an HTS token
I have a question regarding an INSUFFICIENT_TX_FEE error that I am getting for the following cases. First, some background: I have a contract that is supposed to act as a treasury. Prior to the ...
0
votes
1
answer
64
views
How do I get the transaction id after I transfer Hbar using the following code?
I am following this tutorial and writing code to send hbar from my account to another account.
https://docs.hedera.com/hedera/getting-started/transfer-hbar
const sendHbar = await new ...
0
votes
1
answer
20
views
Is there a way to extend the transaction validity over 180 seconds?
Currently, my strategy involves creating a Transaction object (e.g., TransferTransaction) that is configured to meet the necessary requirements, including specifying the required signatures. Next, I ...
1
vote
1
answer
73
views
How to get balance of a token or account for a specific timestamp?
I'm currently working in a project where I need to get balance of a token and accounts balances. I was wondering if you can retrieve the balance for yesterday or any other point in time, bot for ...
3
votes
1
answer
158
views
How can I use Hedera JS SDK to generate a set of ECDSA key-pairs based on a BIP-39 seed phrase and a custom derivation path?
I'm currently using the Hedera JS SDK to generate a single ECDSA key-pair using a private key directly as an input, like so:
const privateKey = PrivateKey.fromStringECDSA(process.env....
0
votes
1
answer
31
views
Where is hedera token / topic metadata housed?
If I were to pass in a JSON object with metadata (ie. key=value pairs) to hedera's token / topic creation API, would a mirror node consume these metadata values as part of the transactions it captures ...
0
votes
1
answer
41
views
TransactionReceipt has empty children array for PrivateKey.fromStringECDSA() but not for PrivateKey.generateECDSA()
When I run the code example for transfer-using-evm-address.js, unmodified, it works.
However, when I change this line:
const privateKey = PrivateKey.generateECDSA();
to this:
const privateKey ...