# transaction (tx)

You can record or modify registered data on the chain by using the daemon’s transaction command.

{% hint style="info" %}
When executing the transaction, you must put in the --chain-id, --fee and --from.\
In the --fees \<default fee of 20000> wallet, your balance must be equal to or higher than the transaction fee amount.
{% endhint %}

## tx authz

Authorize and revoke access to execute transactions on behalf of your address.

### `exec`

execute tx on behalf of granter account.

***Usage***

```
firmachaind tx authz exec <json file path>
```

***Example***

```
firmachaind tx authz exec "./txMsg.json"
```

### `grant`

grant authorization to an address to execute a transaction on your behalf.

***Usage***

```
firmachaind tx authz grant <grantee> <authorization_type="send"|"generic"|"delegate"|"unbond"|"redelegate">
```

***Example***

```
firmachaind tx authz grant firma1e..y5a43qc delegate --allowed-validators "firma1e..y5a43qc","firma1n..65ux9u"
```

### `revoke`

Authorize and revoke access to execute transactions on behalf of your address.

***Usage***

```
firmachaind tx authz revoke <msg_type>
```

***Example***

```
firmachaind tx authz revoke firma1e..y5a43qc
```

## tx bank

You can send tokens to a different wallet.

### `send`

Send funds from one account to another. Note, the'--from' flag is ignored as it is implied from.

***Usage***

```
firmachaind tx bank send <from-keyname> <to-address> <amount>ufct
```

***Example***

```
firmahcaind tx bank send mykey firma1e..y5a43qc 1000000ufct
```

## tx contract

You can record the log or the file hash of a contract.

### `add-contract-log`

Add a new contractLog.

***Usage***

```
firmachaind tx contract add-contract-log <contractHash> <timeStamp> <eventName> <ownerAddress> <jsonString>
```

***Example***

```
firmachaind tx contract add-contract-log 67nah007sb..fh 1671532065 "CreateContact" firma10ne3nw4kcfj6vjz84l2m3gj8vyaczfhma5ff69 "{'totalOwner': 4}"
```

### `create-contract-file`

contract transactions subcommands.

***Usage***

```
firmachaind tx contract create-contract-file <fileHash> <timeStamp> <ownerList("address,address")> <metaDataJsonString>
```

***Example***

```
firmachaind tx contract create-contract-file 67nah007sb..fh 1671532065 "firma1e..y5a43qc","firma1n..65ux9u" {}
```

## tx distribution

Distribution transactions subcommands.

### `fund-community-pool`

Funds the community pool with the specified amount.

***Usage***

```
firmachaind tx distribution fund-community-pool <amount>ufct
```

***Example***

```
firmachaind tx distribution fund-community-pool 1000000ufct
```

### set-withdraw-addr

Set the withdraw address for rewards associated with a delegator address.

***Usage***

```
firmachaind tx distribution set-withdraw-addr <withdraw-addr>
```

***Example***

```
firmachaind tx distribution set-withdraw-addr firma1n..65ux9u
```

### `withdraw-all-rewards`

Withdraw all rewards for a single delegator. Note that if you use this command with --broadcast-mode=sync or --broadcast-mode=async, the max-msgs flag will automatically be set to 0.

***Usage***

```
firmachaind tx distribution withdraw-all-rewards
```

***Example***

```
firmachaind tx distribution withdraw-all-rewards
```

### `withdraw-rewards`

Withdraw rewards from a given delegation address, and optionally withdraw validator commission if the delegation address given is a validator operator.

***Usage***

```
firmachaind tx distribution withdraw-rewards <validator-addr>
```

***Example***

```
firmachaind tx distribution withdraw-rewards firmavaloper..y2w72qk
```

Use the --commission flag to receive commission rewards.

## tx feegrant

Grant and revoke fee allowance for a grantee by a granter

### `grant`

Grant authorization to pay fees from your address. Note, the'--from' flag is ignored as it is implied from \[granter].

***Usage***

```
firmachaind tx feegrant grant <granter_key_or_address> <grantee>
```

***Example***

```
firmachaind tx feegrant grant mykey firma1e..y5a43qc
```

### `revoke`

revoke fee grant from a granter to a grantee. Note, the'--from' flag is ignored as it is implied from \[granter].

***Usage***

```
firmachaind tx feegrant revoke <granter_address> <grantee>
```

***Example***

```
firmachaind tx feegrant revoke firma1n..65ux9u firma1e..y5a43qc
```

## tx gov

Governance transactions subcommands.

### `deposit`

Submit a deposit for an active proposal. You can find the proposal-id by running "firmachaind query gov proposals".&#x20;

***Usage***

```
firmachaind tx gov deposit <proposal-id> <deposit-amount>ufct
```

***Example***

```
firmachaind tx gov deposit 1 10ufct
```

### `submit-proposal`

Submit a proposal along with an initial deposit. Proposal title, description, type and deposit can be given directly or through a proposal JSON file.

***Where proposal.json contain***

```
{
  "title": "Test Proposal",
  "description": "My awesome proposal",
  "type": "Text",
  "deposit": "10000ufct"
}
```

### `submit-proposal cancel-software-upgrade`

Cancel a software upgrade along with an initial deposit.

***Usage***

```
firmachaind tx gov submit-proposal cancel-software-upgrade
```

### `submit-proposal community-pool-spend`

Submit a community pool spend proposal along with an initial deposit. The proposal details must be supplied via a JSON file.

***Where proposal.json contain***

```
{
  "title": "Community Pool Spend",
  "description": "Pay me some UFCT!",
  "recipient": "firma1e..y5a43qc",
  "amount": "1000ufct",
  "deposit": "1000ufct"
}
```

***Usage***

```
firmachaind tx gov submit-proposal community-pool-spend <proposal-file>
```

***Example***

```
firmachaind tx gov submit-proposal community-pool-spend ./proposal.json
```

### `submit-proposal param-change`

Submit a parameter proposal along with an initial deposit. The proposal details must be supplied via a JSON file. For values that contains objects, only non-empty fields will be updated.

***Where proposal.json contain***

```
{
  "title": "Staking Param Change",
  "description": "Update max validators",
  "changes": [
    {
      "subspace": "staking",
      "key": "MaxValidators",
      "value": 80
    }
  ],
  "deposit": "50000ufct"
}
```

***Usage***

```
firmachaind tx gov submit-proposal param-change <proposal-file>
```

***Example***

```
firmachaind tx gov submit-proposal param-change proposal.json
```

### `submit-proposal software-upgrade`

Submit a software upgrade along with an initial deposit. Please specify a unique name and height for the upgrade to take effect.

***Usage***

```
firmachaind tx gov submit-proposal software-upgrade <version-name> \
--title <title> \
--description <description> \
--upgrade-height <block-height>
--deposit <deposit-amount>ufct
```

***Example***

```
firmachaind tx gov submit-proposal software-upgrade "v0.3.5" \
--title "Software Upgrade v0.3.5" \
--description "support module upgrade : bank, ibc\n let's upgrade" \
--upgrade-height 27100
--deposit 5000000ufct
```

### `vote`

Submit a vote for an active proposal. You can find the proposal-id by running "firmachaind query gov proposals".

***Usage***

```
firmachaind tx gov vote <proposal-id> <option>
```

***Example***

```
firmachaind tx gov vote 1 yes
```

### `weighted-vote`

Submit a vote for an active proposal. You can find the proposal-id by running "firmachaind query gov proposals".

***Usage***

```
firmachaind tx gov weighted-vote <proposal-id> <weighted-options>
```

***Example***

```
firmachaind tx gov weighted-vote 1 yes=0.6,no=0.3,abstain=0.05,no_with_veto=0.05
```

## tx ibc-transfer

IBC fungible token transfer transaction subcommands.

### `transfer`

Transfer a fungible token through IBC. Timeouts can be specified as absolute or relative using the "absolute-timeouts" flag. Timeout height can be set by passing in the height string in the form {revision}-{height} using the "packet-timeout-height" flag. Relative timeout height is added to the block height queried from the latest consensus state corresponding to the counterparty channel. Relative timeout timestamp is added to the greater value of the local clock time and the block timestamp queried from the latest consensus state corresponding to the counterparty channel. Any timeout set to 0 is disabled.

***Usage***

```
firmachaind tx ibc-transfer transfer <src-port> <src-channel> <receiver> <amount>
```

***Example***

```
firmachaind tx ibc-transfer transfer transfer channle-0 cosmos1... 100000ufct
```

## tx nft

You can use features such as NFT registration, deletion and transfer.

### `burn`

Broadcast message burn.

***Usage***

```
firmachaind tx nft burn <nftId>
```

***Example***

```
firmachaind tx nft burn 1
```

### `mint`

Broadcast message mint.

***Usage***

```
firmachaind tx nft mint <tokenURI>
```

***Example***

```
firmachaind tx nft mint https://firmachain.org
```

### `transfer`

Broadcast message transfer.

***Usage***

```
firmachaind tx nft transfer <nftId> <toAddress>
```

***Example***

```
firmachaind tx nft transfer 1 firma1e..y5a43qc
```

## tx slashing

This feature allows jailed Validators to rejoin the network.

### `unjail`

unjail a jailed validator.

***Usage***

```
firmachaind tx slashing unjail
```

## tx staking

This feature provides Validator registration, modification and deposit.

### `create-validator`

create new validator initialized with a self-delegation to it.

***Usage***

```
firmachaind tx staking create-validator \
--pubkey <validator-pubkey> \
--amount <staking-amount>ufct \
--moniker <moniker-name> \
--website <website-url> \
--security-contact <email-address> \
--details <validator-optional-details> \
--commission-rate <commission-rate(0.05 ~ 1.00)> \
--commission-max-rate <commission-max-rate(0.01 ~ 1.00)> \
--commission-max-change-rate <commission-max-change-rate(0.01 ~ 1.00)> \
--min-self-delegation <self-delegation-amount> \
--identity <keybase-64bit-code>
```

***Example***

```
firmachaind tx staking create-validator \
--pubkey $(firmachaind tendermint show-validator) \
--amount 10000000ufct \
--moniker "myValidator" \
--website "https://myvalidator.com" \
--security-contact "contact@myvalidator.com" \
--details "hello, world" \
--commission-rate 0.05 \
--commission-max-rate 0.02 \
--commission-max-change-rate 0.8 \
--min-self-delegation 100 \
--identity 64BA6..EU
```

### `delegate`

Delegate an amount of liquid coins to a validator from your wallet.

***Usage***

```
firmachaind tx staking delegate <validator-addr> <amount>ufct
```

***Example***

```
firmachaind tx staking delegate firmavaloper..y2w72qk 35000ufct
```

### `edit-validator`

edit an existing validator account.

***Usage***

```
firmachaind tx staking edit-validator \
--moniker <moniker-name> \
--website <website-url> \
--security-contact <email-address> \
--details <validator-optional-details> \
--commission-rate <commission-rate(0.05 ~ 1.00)> \
--commission-max-rate <commission-max-rate(0.01 ~ 1.00)> \
--commission-max-change-rate <commission-max-change-rate(0.01 ~ 1.00)>
--min-self-delegation <self-delegation-amount> \
--identity <keybase-64bit-code>
```

***Example***

```
firmachaind tx staking edit-validator \
--moniker "myVaildator" \
--website "https://myvalidator.com" \
--security-contact "contact@myvalidator.com" \
--details "hello, world" \
--commission-rate 0.05 \
--commission-max-rate 0.02 \
--commission-max-change-rate 0.8 \
--min-self-delegation 10 \
--identity 64BA6..EU
```

### `redelegate`

Redelegate an amount of illiquid staking tokens from one validator to another.

***Usage***

```
firmachaind tx staking redelegate <src-validator-addr> <dst-validator-addr> <amount>ufct
```

***Example***

```
firmachaind tx staking redelegate firmavaloper..y2w72qk firmavaloper..xy8ha9j 1000ufct
```

### `unbond`

Unbond an amount of bonded shares from a validator.

***Usage***

```
firmachaind tx staking unbond <validator-addr> <amount>ufct
```

***Example***

```
firmachaind tx staking unbond firmavaloper..y2w72qk 500ufct
```

## tx wasm

The CosmWasm module enables smart contracts.

### `clear-contract-admin, clear-admin, clr-adm`

Clears admin for a contract to prevent further migrations.

{% hint style="info" %}
contract\_addr\_bech32 value has no relation to the wallet-address.
{% endhint %}

***Usage***

```
firmachaind tx wasm clear-contract-admin <contract-addr-bech32>
```

***Example***

```
firmachaind tx wasm clear-contract-admin firma14hj2t..
```

### `execute, run, call, exec, ex, e`

Invokes processing functions on the smart contract.

***Usage***

```
firmachaind tx wasm execute <contract-addr-bech32> <json-encoded-send-args> --amount <coins,optional>
```

***Example***

```
firmachaind tx wasm execute firma14hj2t.. '{"register":{"name":"fred"}}' --amount="1000ufct"
```

### `instantiate, start, init, inst, i`

Creates a new instance of an uploaded wasm code with the given 'constructor' message. Each contract instance has a unique address assigned.

***Usage***

```
firmachaind tx wasm instantiate <code-id-int64> <json-encoded-init-args> \
--admin <address,optional> \
--amount <coins,optional> \
--label <text>
```

***Example***

```
firmachaind tx wasm instantiate 1 '{"foo":"bar"}' \
--admin="$(firmachaind keys show mykey -a)" \
--amount="100ustake" \
--label "local0.1.0"
```

### `migrate, update, mig, m`

Migrate a wasm contract to a new code version.

***Usage***

```
firmachaind tx wasm migrate <contract-addr-bech32> <new-code-id-int64> <json-encoded-migration-args>
```

***Example***

```
firmachaind tx wasm migrate firma14hj2t.. 10 '{"verifier": "firma1..."}'
```

### `store, upload, st, s`

Upload a wasm binary.

***Usage***

```
firmachaind tx wasm store <wasm-file>
```

***Example***

```
firmachaind tx wasm store ./cw20_base.wasm
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.firmachain.org/master/developer/firmachaind/sub-commands/transaction-tx.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
