跳到主要内容

Offer CLI

Note about Windows command escaping

This document will use Linux/MacOS RPC syntax. When running rpc commands on Windows, you'll need to escape all quotes with backslashes.

For example, here is a typical RPC command on Linux and MacOS:

chia rpc wallet create_new_wallet '{"wallet_type": "nft_wallet"}'

To run the same command on Windows, you need to escape the quotes, so it looks like this:

chia rpc wallet create_new_wallet '{\"wallet_type\": \"nft_wallet\"}'

Reference

make_offer

Functionality: Create an offer of XCH/CATs for XCH/CATs.

Usage: chia wallet make_offer [OPTIONS]

Options:

Short CommandLong CommandTypeRequiredDescription
-wp--wallet-rpc-portINTEGERFalseSet the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml
-f--fingerprintINTEGERFalseSet the fingerprint to specify which wallet to use
-o--offerTEXTTrueA wallet id to offer and the amount to offer (formatted like wallet_id:amount)
-r--requestTEXTTrueA wallet id of an asset to receive and the amount you wish to receive (formatted like wallet_id:amount)
-p--filepathTEXTTrueThe path to write the generated offer file to
-m--feeTEXTFalseA fee to add to the offer when it gets taken
--reuseNoneFalseSet this flag to reuse an existing address for the offer [Default: generate a new address]
--overrideNoneFalseCreates offer without checking for unusual values
-h--helpNoneFalseShow a help message and exit

take_offer

Functionality: Examine or take an offer.

Usage: chia wallet take_offer [OPTIONS] PATH_OR_HEX

Options:

Short CommandLong CommandTypeRequiredDescription
-wp--wallet-rpc-portINTEGERFalseSet the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml
-f--fingerprintINTEGERFalseSet the fingerprint to specify which wallet to use
-e--examine-onlyNoneFalsePrint the summary of the offer file but do not take it
-m--feeTEXTFalseThe fee to use when pushing the completed offer
--reuseNoneFalseSet this flag to reuse an existing address for the offer [Default: generate a new address]
-h--helpNoneFalseShow a help message and exit

cancel_offer

Functionality: Cancel an existing offer. Must be the offer's Maker.

Usage: chia wallet cancel_offer [OPTIONS]

Options:

Short CommandLong CommandTypeRequiredDescription
-wp--wallet-rpc-portINTEGERFalseSet the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml
-f--fingerprintINTEGERFalseSet the fingerprint to specify which wallet to use
-id--idTEXTTrueThe offer ID that you wish to cancel
--insecureNoneFalseSet this flag to disable making an on-chain transaction and simply mark the offer as canceled [Default: cancel on-chain]
-m--feeTEXTFalseThe fee to use when canceling the offer securely
-h--helpNoneFalseShow a help message and exit

get_offers

Functionality: Get the status of existing offers.

Usage: chia wallet get_offers [OPTIONS]

Options:

Short CommandLong CommandTypeRequiredDescription
-wp--wallet-rpc-portINTEGERFalseSet the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml
-f--fingerprintINTEGERFalseSet the fingerprint to specify which wallet to use
-id--idTEXTFalseThe ID of the offer that you wish to examine
-p--filepathTEXTFalseThe path to rewrite the offer file to (must be used in conjunction with --id)
-em--exclude-my-offersNoneFalseExclude your own offers from the output
-et--exclude-taken-offersNoneFalseExclude offers that you've accepted from the output
-ic--include-completedNoneFalseInclude offers that have already been confirmed/canceled or failed
-s--summariesNoneFalseShow the assets being offered and requested for each offer
-r--reverseNoneFalseReverse the order of the output
-h--helpNoneFalseShow a help message and exit