fetchFeeEstimate
Usage
import {
makeUnsignedSTXTokenTransfer,
fetchFeeEstimate,
} from '@stacks/transactions';
const transaction = await makeUnsignedSTXTokenTransfer({
recipient: 'ST1SJ3DTE5DN7X54YDH5D64R3BCB6A2AG2ZQ8YPD5',
amount: 1000000n,
publicKey: '034f355bdcb7cc0af728ef3cceb9615d90684bb5b2ca5f859ab0f0b704075871aa',
network: 'testnet',
fee: 0, // placeholder — we'll estimate
nonce: 0n,
});
const estimatedFee = await fetchFeeEstimate({
transaction,
network: 'testnet',
});
transaction.setFee(estimatedFee);Notes
Signature
Returns
Parameters
opts.transaction (required)
opts.network (optional)
opts.client (optional)
Last updated
Was this helpful?