Fees
_6import { Fee } from '@terra-money/terra.js';_6_6const msgs = [ new MsgSend( ... ), new MsgExecuteContract( ... ), ]; // messages_6const fee = new Fee(50000, { uluna: 4500000 });_6_6const tx = await wallet.createAndSignTx({ msgs, fee });
Automatic fee estimation
If you don't specify a fee when you create your transaction, it will automatically be estimated by simulating it within the node.
_1const tx = await wallet.createAndSignTx({ msgs });
You can define the fee estimation parameters when you create your LCDClient instance. The defaults are:
_6const terra = new LCDClient({_6 URL: "https://phoenix-lcd.terra.dev",_6 chainID: "phoenix-1",_6 gasPrices: { uluna: 0.015 },_6 gasAdjustment: 1.4,_6});
You can override these settings by passing the fee estimation parameters in wallet.createTx or wallet.createAndSignTx:
_5const tx = await wallet.createAndSignTx({_5 msgs,_5 gasPrices: { ukrw: 0.01 },_5 gasAdjustment: 1.9,_5});