Command Line Interface (CLI)
After you have installed, type swap
to verify that it worked:
$ swap
Usage: swap [OPTIONS] COMMAND [ARGS]...
Options:
-v, --version Show Swap version and exit.
-h, --help Show this message and exit.
Commands:
bitcoin Select Bitcoin provider.
bytom Select Bytom provider.
ethereum Select Ethereum provider.
vapor Select Vapor provider.
xinfin Select XinFin provider.
swap
swap [OPTIONS] COMMAND [ARGS]...
Options
- -v, --version
Show Swap version and exit.
bitcoin
Select Bitcoin provider.
swap bitcoin [OPTIONS] COMMAND [ARGS]...
decode
Select Bitcoin Transaction raw decoder.
swap bitcoin decode [OPTIONS]
Options
- -tr, --transaction-raw <transaction_raw>
Required Set Bitcoin transaction raw.
- -i, --indent <indent>
Set json indent.
- Default
4
- -o, --offline <offline>
Set Offline decode transaction raw.
- Default
True
fund
Select Bitcoin Fund transaction builder.
swap bitcoin fund [OPTIONS]
Options
- -a, --address <address>
Required Set Bitcoin sender address.
- -ca, --contract-address <contract_address>
Required Set Bitcoin Hash Time Lock Contract (HTLC) address.
- -am, --amount <amount>
Required Set Bitcoin fund amount.
- -u, --unit <unit>
Set Bitcoin fund amount unit.
- Default
Satoshi
- -n, --network <network>
Set Bitcoin network.
- Default
mainnet
- -v, --version <version>
Set Bitcoin transaction version.
- Default
2
htlc
Select Bitcoin Hash Time Lock Contract (HTLC) builder.
swap bitcoin htlc [OPTIONS]
Options
- -sh, --secret-hash <secret_hash>
Required Set secret 256 hash.
- -ra, --recipient-address <recipient_address>
Required Set Bitcoin recipient address.
- -sa, --sender-address <sender_address>
Required Set Bitcoin sender address.
- -e, --endtime <endtime>
Required Set Expiration block time (Seconds).
- -n, --network <network>
Set Bitcoin network.
- Default
mainnet
- -i, --indent <indent>
Set json indent.
- Default
4
refund
Select Bitcoin Refund transaction builder.
swap bitcoin refund [OPTIONS]
Options
- -a, --address <address>
Required Set Bitcoin sender address.
- -th, --transaction-hash <transaction_hash>
Required Set Bitcoin funded transaction hash/id.
- -n, --network <network>
Set Bitcoin network.
- Default
mainnet
- -v, --version <version>
Set Bitcoin transaction version.
- Default
2
sign
Select Bitcoin Transaction raw signer.
swap bitcoin sign [OPTIONS]
Options
- -xpk, --xprivate-key <xprivate_key>
Required Set Bitcoin root xprivate key.
- -tr, --transaction-raw <transaction_raw>
Required Set Bitcoin unsigned transaction raw.
- -b, --bytecode <bytecode>
Set Bitcoin witness HTLC bytecode. [default: None]
- -sk, --secret-key <secret_key>
Set secret key. [default: None]
- -e, --endtime <endtime>
Set Expiration block timestamp. [default: None]
- -ac, --account <account>
Set Bitcoin derivation from account.
- Default
1
- -ch, --change <change>
Set Bitcoin derivation from change.
- Default
False
- -ad, --address <address>
Set Bitcoin derivation from address.
- Default
1
- -p, --path <path>
Set Bitcoin derivation from path. [default: None]
- -v, --version <version>
Set Bitcoin transaction version.
- Default
2
submit
Select Bitcoin Transaction raw submitter.
swap bitcoin submit [OPTIONS]
Options
- -tr, --transaction-raw <transaction_raw>
Required Set signed Bitcoin transaction raw.
- -e, --endpoint <endpoint>
Set submission endpoint API name.
withdraw
Select Bitcoin Withdraw transaction builder.
swap bitcoin withdraw [OPTIONS]
Options
- -a, --address <address>
Required Set Bitcoin recipient address.
- -th, --transaction-hash <transaction_hash>
Required Set Bitcoin funded transaction hash/id.
- -n, --network <network>
Set Bitcoin network.
- Default
mainnet
- -v, --version <version>
Set Bitcoin transaction version.
- Default
2
bytom
Select Bytom provider.
swap bytom [OPTIONS] COMMAND [ARGS]...
decode
Select Bytom Transaction raw decoder.
swap bytom decode [OPTIONS]
Options
- -tr, --transaction-raw <transaction_raw>
Required Set Bytom transaction raw.
- -i, --indent <indent>
Set json indent.
- Default
4
fund
Select Bytom Fund transaction builder.
swap bytom fund [OPTIONS]
Options
- -a, --address <address>
Required Set Bytom sender address.
- -ca, --contract-address <contract_address>
Required Set Bytom Hash Time Lock Contract (HTLC) address.
- -am, --amount <amount>
Required Set Bytom fund amount.
- -u, --unit <unit>
Set Bytom amount unit.
- Default
NEU
- -as, --asset <asset>
Set Bytom asset id.
- Default
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
- -n, --network <network>
Set Bytom network.
- Default
mainnet
htlc
Select Bytom Hash Time Lock Contract (HTLC) builder.
swap bytom htlc [OPTIONS]
Options
- -sh, --secret-hash <secret_hash>
Required Set secret 256 hash.
- -rpk, --recipient-public-key <recipient_public_key>
Required Set Bytom recipient public key.
- -spk, --sender-public-key <sender_public_key>
Required Set Bytom sender public key.
- -e, --endblock <endblock>
Required Set Bytom expiration block height.
- -n, --network <network>
Set Bytom network.
- Default
mainnet
- -i, --indent <indent>
Set json indent.
- Default
4
refund
Select Bytom Refund transaction builder.
swap bytom refund [OPTIONS]
Options
- -a, --address <address>
Required Set Bytom sender address.
- -th, --transaction-hash <transaction_hash>
Required Set Bytom funded transaction id/hash.
- -as, --asset <asset>
Set Bytom asset id.
- Default
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
- -n, --network <network>
Set Bytom network.
- Default
mainnet
sign
Select Bytom Transaction raw signer.
swap bytom sign [OPTIONS]
Options
- -xpk, --xprivate-key <xprivate_key>
Required Set Bytom xprivate key.
- -tr, --transaction-raw <transaction_raw>
Required Set Bytom unsigned transaction raw.
- -b, --bytecode <bytecode>
Set Bytom witness HTLC bytecode. [default: None]
- -sk, --secret-key <secret_key>
Set secret key. [default: None]
- -ac, --account <account>
Set Bytom derivation from account.
- Default
1
- -ch, --change <change>
Set Bytom derivation from change.
- Default
False
- -ad, --address <address>
Set Bytom derivation from address.
- Default
1
- -p, --path <path>
Set Bytom derivation from path. [default: None]
- -i, --indexes <indexes>
Set Bytom derivation from indexes. [default: None]
submit
Select Bytom Transaction raw submitter.
swap bytom submit [OPTIONS]
Options
- -tr, --transaction-raw <transaction_raw>
Required Set signed Bytom transaction raw.
withdraw
Select Bytom Withdraw transaction builder.
swap bytom withdraw [OPTIONS]
Options
- -a, --address <address>
Required Set Bytom recipient address.
- -th, --transaction-hash <transaction_hash>
Required Set Bytom funded transaction hash/id.
- -as, --asset <asset>
Set Bytom asset id.
- Default
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
- -n, --network <network>
Set Bytom network.
- Default
mainnet
ethereum
Select Ethereum provider.
swap ethereum [OPTIONS] COMMAND [ARGS]...
decode
Select Ethereum Transaction raw decoder.
swap ethereum decode [OPTIONS]
Options
- -tr, --transaction-raw <transaction_raw>
Required Set Ethereum transaction raw.
- -i, --indent <indent>
Set json indent.
- Default
4
fund
Select Ethereum Fund transaction builder.
swap ethereum fund [OPTIONS]
Options
- -sh, --secret-hash <secret_hash>
Required Set secret 256 hash.
- -ra, --recipient-address <recipient_address>
Required Set Ethereum recipient address.
- -sa, --sender-address <sender_address>
Required Set Ethereum sender address.
- -e, --endtime <endtime>
Required Set Expiration block timestamp.
- -am, --amount <amount>
Required Set Ethereum fund amount.
- -u, --unit <unit>
Set Ethereum fund amount unit.
- Default
Wei
- -ca, --contract-address <contract_address>
Set Ethereum HTLC contact address. [default: None]
- -ta, --token-address <token_address>
Set Ethereum ERC20 token address. [default: None]
- -n, --network <network>
Set Ethereum network.
- Default
mainnet
- -e20, --erc20 <erc20>
Set Enable Ethereum ERC20 token contract.
- Default
False
htlc
Select Ethereum Hash Time Lock Contract (HTLC) builder.
swap ethereum htlc [OPTIONS]
Options
- -ca, --contract-address <contract_address>
Set Ethereum HTLC contact address. [default: None]
- -n, --network <network>
Set Ethereum network.
- Default
mainnet
- -e20, --erc20 <erc20>
Set Enable Ethereum ERC20 token contract.
- Default
False
- -i, --indent <indent>
Set json indent.
- Default
4
refund
Select Ethereum Refund transaction builder.
swap ethereum refund [OPTIONS]
Options
- -th, --transaction-hash <transaction_hash>
Required Set Ethereum funded transaction hash/id.
- -a, --address <address>
Required Set Ethereum sender address.
- -ca, --contract-address <contract_address>
Set Ethereum HTLC contact address. [default: None]
- -n, --network <network>
Set Ethereum network.
- Default
mainnet
- -e20, --erc20 <erc20>
Set Enable Ethereum ERC20 token contract.
- Default
False
sign
Select Ethereum Transaction raw signer.
swap ethereum sign [OPTIONS]
Options
- -xpk, --xprivate-key <xprivate_key>
Required Set Ethereum root xprivate key.
- -tr, --transaction-raw <transaction_raw>
Required Set Ethereum unsigned transaction raw.
- -ac, --account <account>
Set Ethereum derivation from account.
- Default
0
- -ch, --change <change>
Set Ethereum derivation from change.
- Default
False
- -ad, --address <address>
Set Ethereum derivation from address.
- Default
0
- -p, --path <path>
Set Ethereum derivation from path. [default: None]
submit
Select Ethereum Transaction raw submitter.
swap ethereum submit [OPTIONS]
Options
- -tr, --transaction-raw <transaction_raw>
Required Set signed Ethereum transaction raw.
withdraw
Select Ethereum Withdraw transaction builder.
swap ethereum withdraw [OPTIONS]
Options
- -th, --transaction-hash <transaction_hash>
Required Set Ethereum funded transaction hash/id.
- -a, --address <address>
Required Set Ethereum recipient address.
- -sk, --secret-key <secret_key>
Required Set secret password/passphrase.
- -ca, --contract-address <contract_address>
Set Ethereum HTLC contact address. [default: None]
- -n, --network <network>
Set Ethereum network.
- Default
mainnet
- -e20, --erc20 <erc20>
Set Enable Ethereum ERC20 token contract.
- Default
False
vapor
Select Vapor provider.
swap vapor [OPTIONS] COMMAND [ARGS]...
decode
Select Vapor Transaction raw decoder.
swap vapor decode [OPTIONS]
Options
- -tr, --transaction-raw <transaction_raw>
Required Set Vapor transaction raw.
- -i, --indent <indent>
Set json indent.
- Default
4
fund
Select Vapor Fund transaction builder.
swap vapor fund [OPTIONS]
Options
- -a, --address <address>
Required Set Vapor sender address.
- -ca, --contract-address <contract_address>
Required Set Vapor Hash Time Lock Contract (HTLC) address.
- -am, --amount <amount>
Required Set Vapor fund amount.
- -u, --unit <unit>
Set Vapor amount unit.
- Default
NEU
- -as, --asset <asset>
Set Vapor asset id.
- Default
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
- -n, --network <network>
Set Vapor network.
- Default
mainnet
htlc
Select Vapor Hash Time Lock Contract (HTLC) builder.
swap vapor htlc [OPTIONS]
Options
- -sh, --secret-hash <secret_hash>
Required Set secret 256 hash.
- -rpk, --recipient-public-key <recipient_public_key>
Required Set Vapor recipient public key.
- -spk, --sender-public-key <sender_public_key>
Required Set Vapor sender public key.
- -e, --endblock <endblock>
Required Set Vapor expiration block height.
- -n, --network <network>
Set Vapor network.
- Default
mainnet
- -i, --indent <indent>
Set json indent.
- Default
4
refund
Select Vapor Refund transaction builder.
swap vapor refund [OPTIONS]
Options
- -a, --address <address>
Required Set Vapor sender address.
- -th, --transaction-hash <transaction_hash>
Required Set Vapor funded transaction id/hash.
- -as, --asset <asset>
Set Vapor asset id.
- Default
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
- -n, --network <network>
Set Vapor network.
- Default
mainnet
sign
Select Vapor Transaction raw signer.
swap vapor sign [OPTIONS]
Options
- -xpk, --xprivate-key <xprivate_key>
Required Set Vapor xprivate key.
- -tr, --transaction-raw <transaction_raw>
Required Set Vapor unsigned transaction raw.
- -b, --bytecode <bytecode>
Set Vapor witness HTLC bytecode. [default: None]
- -sk, --secret-key <secret_key>
Set secret key. [default: None]
- -ac, --account <account>
Set Vapor derivation from account.
- Default
1
- -ch, --change <change>
Set Vapor derivation from change.
- Default
False
- -ad, --address <address>
Set Vapor derivation from address.
- Default
1
- -p, --path <path>
Set Vapor derivation from path. [default: None]
- -i, --indexes <indexes>
Set Vapor derivation from indexes. [default: None]
submit
Select Vapor Transaction raw submitter.
swap vapor submit [OPTIONS]
Options
- -tr, --transaction-raw <transaction_raw>
Required Set signed Vapor transaction raw.
withdraw
Select Vapor Withdraw transaction builder.
swap vapor withdraw [OPTIONS]
Options
- -a, --address <address>
Required Set Vapor recipient address.
- -th, --transaction-hash <transaction_hash>
Required Set Vapor funded transaction hash/id.
- -as, --asset <asset>
Set Vapor asset id.
- Default
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
- -n, --network <network>
Set Vapor network.
- Default
mainnet
xinfin
Select XinFin provider.
swap xinfin [OPTIONS] COMMAND [ARGS]...
decode
Select XinFin Transaction raw decoder.
swap xinfin decode [OPTIONS]
Options
- -tr, --transaction-raw <transaction_raw>
Required Set XinFin transaction raw.
- -i, --indent <indent>
Set json indent.
- Default
4
fund
Select XinFin Fund transaction builder.
swap xinfin fund [OPTIONS]
Options
- -sh, --secret-hash <secret_hash>
Required Set secret 256 hash.
- -ra, --recipient-address <recipient_address>
Required Set XinFin recipient address.
- -sa, --sender-address <sender_address>
Required Set XinFin sender address.
- -e, --endtime <endtime>
Required Set Expiration block timestamp.
- -am, --amount <amount>
Required Set XinFin fund amount.
- -u, --unit <unit>
Set XinFin fund amount unit.
- Default
Wei
- -ca, --contract-address <contract_address>
Set XinFin HTLC contact address. [default: None]
- -ta, --token-address <token_address>
Set XinFin XRC20 token address. [default: None]
- -n, --network <network>
Set XinFin network.
- Default
mainnet
- -x20, --xrc20 <xrc20>
Set Enable XinFin XRC20 token contract.
- Default
False
htlc
Select XinFin Hash Time Lock Contract (HTLC) builder.
swap xinfin htlc [OPTIONS]
Options
- -ca, --contract-address <contract_address>
Set XinFin HTLC contact address. [default: None]
- -n, --network <network>
Set XinFin network.
- Default
mainnet
- -x20, --xrc20 <xrc20>
Set Enable XinFin XRC20 token contract.
- Default
False
- -i, --indent <indent>
Set json indent.
- Default
4
refund
Select XinFin Refund transaction builder.
swap xinfin refund [OPTIONS]
Options
- -th, --transaction-hash <transaction_hash>
Required Set XinFin funded transaction hash/id.
- -a, --address <address>
Required Set XinFin sender address.
- -ca, --contract-address <contract_address>
Set XinFin HTLC contact address. [default: None]
- -n, --network <network>
Set XinFin network.
- Default
mainnet
- -x20, --xrc20 <xrc20>
Set Enable XinFin XRC20 token contract.
- Default
False
sign
Select XinFin Transaction raw signer.
swap xinfin sign [OPTIONS]
Options
- -xpk, --xprivate-key <xprivate_key>
Required Set XinFin root xprivate key.
- -tr, --transaction-raw <transaction_raw>
Required Set XinFin unsigned transaction raw.
- -ac, --account <account>
Set XinFin derivation from account.
- Default
0
- -ch, --change <change>
Set XinFin derivation from change.
- Default
False
- -ad, --address <address>
Set XinFin derivation from address.
- Default
0
- -p, --path <path>
Set XinFin derivation from path. [default: None]
submit
Select XinFin Transaction raw submitter.
swap xinfin submit [OPTIONS]
Options
- -tr, --transaction-raw <transaction_raw>
Required Set signed XinFin transaction raw.
withdraw
Select XinFin Withdraw transaction builder.
swap xinfin withdraw [OPTIONS]
Options
- -th, --transaction-hash <transaction_hash>
Required Set XinFin funded transaction hash/id.
- -a, --address <address>
Required Set XinFin recipient address.
- -sk, --secret-key <secret_key>
Required Set secret password/passphrase.
- -ca, --contract-address <contract_address>
Set XinFin HTLC contact address. [default: None]
- -n, --network <network>
Set XinFin network.
- Default
mainnet
- -x20, --xrc20 <xrc20>
Set Enable XinFin XRC20 token contract.
- Default
False