CLI

NEM2-CLI is an open-source command-line interface to interact with the blockchain.

Installation

NEM2-CLI is distributed using the node package manager npm.

npm install --global nem2-cli

Configuration

To start using NEM2-CLI, configure a profile. Profiles are used to set a base URL and have an account to sign transactions.

nem2-cli profile import --private-key your_private_key --network TEST_NET --url http://api-harvest-20.us-west-1.nemtech.network:3000 --password your_password --profile test_net_profile

By default, NEM2-CLI will always use the default profile. To use a named profile, add the --profile option to the command.

nem2-cli account info --profile test_net_profile

If you are going to use named profile for multiple commands, you can change the default profile with the following command.

nem2-cli profile setdefault --profile new_profile

If you do not have a private key to create a profile, you can generate a new account, add a node URL and save it as default or named profile.

nem2-cli account generate --network TEST_NET -s --url http://api-harvest-20.us-west-1.nemtech.network:3000 --pasword your_password --profile test_net_profile

Commands

Profile

Create

Creates a new profile.

Options

-n, --network <network>                - Network Type. (MAIN_NET, TEST_NET, MIJIN, MIJIN_TEST)
--profile <profile>                    - (Optional) Select between your profiles, by providing a profile name.
-u, --url <url>                        - (Optional) When saving profile, provide a NEM2 Node URL. Example: http://localhost:3000
-p, --password <password>              - (Optional) When saving profile, provide the password.
-d, --default                          - (Optional) Set the profile as default.
-g, --generation-hash <generationHash> - (Optional) Generation hash of the network. Necessary to create the profile offline.

Command

nem2-cli profile create --network TEST_NET --url http://api-harvest-20.us-west-1.nemtech.network:3000 --password 12345678 --profile test_net_profile_2

Import

Creates a new profile from an existent private key.

Options

--profile <profile>                    - (Optional) Select between your profiles, by providing a profile name.
-u, --url <url>                        - (Optional) When saving profile, provide a NEM2 Node URL. Example: http://localhost:3000
-n, --network <network>                - Network Type. (MAIN_NET, TEST_NET, MIJIN, MIJIN_TEST)
-p, --password <password>              - (Optional) When saving profile, provide the password.
-d, --default                          - (Optional) Set the profile as default.
-g, --generation-hash <generationHash> - (Optional) Generation hash of the network. Necessary to create the profile offline.
-P, --private-key <privateKey>         - Account private key.

Command

nem2-cli profile import --private-key 0000000000000000000000000000000000000000000000000000000000000000 --network TEST_NET --url http://api-harvest-20.us-west-1.nemtech.network:3000 --password 12345678 --profile test_net_profile

List

Displays the list of stored profiles.

Options

--profile <profile> - (Optional) Select between your profiles, by providing a profile name.

Command

nem2-cli profile list

Note

NEM2-CLI uses the default profile to connect to a node and set options such as: address, public key and sign transactions with private key. To use a named profile, add the –profile option to any command.

Set default

Change the default profile.

Options

--profile <profile>     - (Optional) Profile name, if not private key will override the default profile.

Command

nem2-cli profile setdefault --profile new_profile

Account

Generate new account

Generates a new account. This command generates a private key, public key and address.

Generated accounts can be stored as named profiles by adding a node url.

Options

--profile <profile>                    - (Optional) Select between your profiles, by providing a profile name.
-u, --url <url>                        - (Optional) When saving profile, provide a NEM2 Node URL. Example: http://localhost:3000
-n, --network <network>                - Network Type. (MAIN_NET, TEST_NET, MIJIN, MIJIN_TEST)
-p, --password <password>              - (Optional) When saving profile, provide the password.
-d, --default                          - (Optional) Set the profile as default.
-g, --generation-hash <generationHash> - (Optional) Generation hash of the network. Necessary to create the profile offline.
-s, --save                             - (Optional) Saves the profile.

Command

nem2-cli account generate --network TEST_NET

Get account info

Returns the account information, such as the public key, importance and mosaics balance.

Options

--profile <profile>     - (Optional) Select between your profiles, by providing a profile name.
-a, --address <address> - Account address.

Command

nem2-cli account info --address TBULEA-UG2CZQ-ISUR44-2HWA6U-AKGWIX-HDABJV-IPS4

Get confirmed transactions

Gets an array of transactions for which an account is the sender or receiver.

Options

--profile <profile>                      - (Optional) Select between your profiles, by providing a profile name.
-a, --address <address>                  - Account address.
-n, --num-transactions <numTransactions> - (Optional) Number of transactions. [10]
-i, --id <id>                            - (Optional) Identifier of the transaction after which we want the transactions to be returned.

Command

nem2-cli account transactions --address TBULEA-UG2CZQ-ISUR44-2HWA6U-AKGWIX-HDABJV-IPS4 --numtransactions 10

Get incoming transactions

Gets an array of incoming transactions. A transaction is said to be incoming with respect to an account if the account is the recipient of the transaction.

Options

--profile <profile>                      - (Optional) Select between your profiles, by providing a profile name.
-a, --address <address>                  - Account address.
-n, --num-transactions <numTransactions> - (Optional) Number of transactions. [10]
-i, --id <id>                            - (Optional) Identifier of the transaction after which we want the transactions to be returned.

Command

nem2-cli account incoming --address TBULEA-UG2CZQ-ISUR44-2HWA6U-AKGWIX-HDABJV-IPS4

Get outgoing transactions

Gets an array of outgoing transactions. A transaction is said to be outgoing with respect to an account if the account is the sender of the transaction.

Options

--profile <profile>                      - (Optional) Select between your profiles, by providing a profile name.
-a, --address <address>                  - Account address.
-n, --num-transactions <numTransactions> - (Optional) Number of transactions. [10]
-i, --id <id>                            - (Optional) Identifier of the transaction after which we want the transactions to be returned.

Command

nem2-cli account incoming --address TBULEA-UG2CZQ-ISUR44-2HWA6U-AKGWIX-HDABJV-IPS4

Get unconfirmed transactions

Gets the array of transactions for which an account is the sender or receiver and which have not yet been included in a block.

Options

--profile <profile>                      - (Optional) Select between your profiles, by providing a profile name.
-a, --address <address>                  - Account address.
-n, --num-transactions <numTransactions> - (Optional) Number of transactions. [10]
-i, --id <id>                            - (Optional) Identifier of the transaction after which we want the transactions to be returned.

Command

nem2-cli account unconfirmed --address TBULEA-UG2CZQ-ISUR44-2HWA6U-AKGWIX-HDABJV-IPS4

Get aggregate bonded transactions

Gets an array of aggregate bonded transactions where the account is the sender or requires to cosign the transaction.

Options

--profile <profile>                      - (Optional) Select between your profiles, by providing a profile name.
-a, --address <address>                  - Account address.
-n, --num-transactions <numTransactions> - (Optional) Number of transactions. [10]
-i, --id <id>                            - (Optional) Identifier of the transaction after which we want the transactions to be returned.

Command

nem2-cli account aggregatebonded --address TBULEA-UG2CZQ-ISUR44-2HWA6U-AKGWIX-HDABJV-IPS4

Block

Header

Returns the block header by height.

Options

--profile <profile>        - (Optional) Select between your profiles, by providing a profile name.
-h, --height <height>      - Block height.

Command

nem2-cli block header --height 1

Transactions

Returns the transactions for a given block height.

Options

--profile <profile>        - (Optional) Select between your profiles, by providing a profile name.
-h, --height <height>      - Block height.
-s, --page-size <pageSize> - (Optional) Page size between 10 and 100. Default: 10
-i, --id <id>              - (Optional) Id after which we want objects to be returned.
-o, --order <order>        - (Optional): Order of transactions. DESC. Newer to older. ASC. Older to newer. Default: DESC

Command

nem2-cli block transactions --height 1

Receipts

Returns the receipts for a given block height.

Options

--profile <profile>        - (Optional) Select between your profiles, by providing a profile name.
-h, --height <height>      - Block height.

Command

nem2-cli block receipts --height 1

Convert

Utilities to convert between data types.

Base32 to Hex Address

Address Base 32 -> Address hex converter.

Options

-a, --address <address> - Address.

Command

nem2-cli converter base32ToHexAddress --address SA3JCE-2LX6Z4-YY72IO-XEQFNQ-W3IQBW-YZINI2-6CPP

Hex to Base32 Address

Address hex -> Address Base 32 converter.

Options

-a, --address <address> - Address.

Command

nem2-cli converter hexToBase32Address --address 903691134BBFB3CC63FA43AE4815B0B6D100DB194351AF09EF

Namespace name to id

Namespace name -> NamespaceId converter.

Options

-n, --namespace-name <namespaceName> - Namespace name.

Command

nem2-cli converter namespaceNameToId --namespace-name test

Numeric string to UInt64

Numeric string -> UInt64 converter.

Options

-a, --amount <amount> - Numeric string. Example: 12345678

Command

nem2-cli converter numericStringToUInt64 --amount 12345678

Payload to transaction

Payload -> Transaction converter.

Options

-p, --payload <payload> - Transaction payload.

Command

nem2-cli converter payloadToTransaction --payload B500000000000000C93D1D5AF5327DAAD47BD1194857EF67EF216C1D2DB241C44BF68886ABFE3CD68805A4388A2805402C3C596605E9C9159DF075745771342D6C336E1F964870A247F5C2324672091EE0D09229ADF2710B4E0A0BE510FC0115D3CAEC728DAC0BE000000000190544100000000000000003B18EA3201000000916EC265194C0501D4000000000000000000000000000000000105000000000044B262C46CEABB85E8030000000000000074657374

Private key to public key

Private key -> Public key converter.

Options

-p, --private-key <privateKey> - Private Key.
-n, --network <network>        - Network Type. (MAIN_NET, TEST_NET, MIJIN, MIJIN_TEST)

Command

nem2-cli converter privateKeyToPublicKey --privateKey FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF --network TEST_NET

Public key to address

Public key -> Address converter.

Options

-p, --public-key <publicKey>   - Public Key.
-n, --network <network>        - Network Type. (MAIN_NET, TEST_NET, MIJIN, MIJIN_TEST)

Command

nem2-cli converter publicKeyToAddress --publicKey FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF --network TEST_NET

String to key

String -> UInt64 converter.

Options

-v, --value <value> - String value.

Command

nem2-cli converter stringToKey --value test

Chain

Chain height

Returns the current height of the block chain.

Options

--profile <profile>                      - (Optional) Select between your profiles, by providing a profile name.

Command

nem2-cli chain height

Chain score

Gets the current score of the block chain. The higher the score, the better the chain. During synchronization, nodes try to get the best block chain in the network.

Options

--profile <profile>  - (Optional) Select between your profiles, by providing a profile name.

Command

nem2-cli chain score

Diagnostic

Server info

Gets the REST server components versions.

Options

--profile <profile>  - (Optional) Select between your profiles, by providing a profile name.

Command

nem2-cli diagnostic serverInfo

Storage

Gets diagnostic information about the node storage.

Options

--profile <profile>  - (Optional) Select between your profiles, by providing a profile name.

Command

nem2-cli diagnostic storage

Metadata

Account

Returns metadata entries from an account.

Options

--profile <profile>     - (Optional) Select between your profiles, by providing a profile name.
-a, --address <address> - Account address.

Command

nem2-cli metadata account --address TBULEA-UG2CZQ-ISUR44-2HWA6U-AKGWIX-HDABJV-IPS4

Mosaic

Returns metadata entries from a mosaic.

Options

--profile <profile>        - (Optional) Select between your profiles, by providing a profile name.
-m, --mosaic-id <mosaicId> - Mosaic id in hexadecimal format.

Command

nem2-cli metadata mosaic --mosaic-id 71415AC19C818709

Namespace

Returns metadata entries from a namespace.

Options

--profile <profile>                  - (Optional) Select between your profiles, by providing a profile name.
-n, --namespace-name <namespaceName> - Namespace name.

Command

nem2-cli metadata namespace --namespace-name foo

Monitor

Catapult command line interface comes with a set of commands to track events in the blockchain.

Block

Monitors new confirmed blocks harvested on the blockchain.

Options

--profile <profile> - (Optional) Select between your profiles, by providing a profile name.

Command

nem2-cli monitor block

Confirmed transactions

Monitors new confirmed transactions signed or received by an account.

Options

--profile <profile>     - (Optional) Select between your profiles, by providing a profile name.
-a, --address <address> - Account address.

Command

nem2-cli monitor confirmed --address TBULEA-UG2CZQ-ISUR44-2HWA6U-AKGWIX-HDABJV-IPS4

Unconfirmed transactions

Monitors new unconfirmed transactions signed or received by an account.

Options

--profile <profile>     - (Optional) Select between your profiles, by providing a profile name.
-a, --address <address> - Account address.

Command

nem2-cli monitor unconfirmed --address TBULEA-UG2CZQ-ISUR44-2HWA6U-AKGWIX-HDABJV-IPS4

Aggregate bonded transactions

Monitors new aggregate transactions with missing signatures added to an account.

Options

--profile <profile>     - (Optional) Select between your profiles, by providing a profile name.
-a, --address <address> - Account address.

Command

nem2-cli monitor aggregatebonded --address TBULEA-UG2CZQ-ISUR44-2HWA6U-AKGWIX-HDABJV-IPS4

Transaction status

Monitors account validation errors.

Options

--profile <profile>     - (Optional) Select between your profiles, by providing a profile name.
-a, --address <address> - Account address.

Command

nem2-cli monitor status --address TBULEA-UG2CZQ-ISUR44-2HWA6U-AKGWIX-HDABJV-IPS4

All

Monitors new blocks, confirmed, aggregate bonded added, and status errors related to an account.

Options

--profile <profile>     - (Optional) Select between your profiles, by providing a profile name.
-a, --address <address> - Account address.

Command

nem2-cli monitor all --address TBULEA-UG2CZQ-ISUR44-2HWA6U-AKGWIX-HDABJV-IPS4

Mosaic

Info

Gets information from a mosaic.

Options

--profile <profile>            - (Optional) Select between your profiles, by providing a profile name.
-m, --mosaic-id <mosaicId>     - Mosaic id in hexadecimal format.

Command

nem2-cli mosaic info --mosaic-id 71415AC19C818709

Namespace

Info

Gets information from a namespace.

Options

--profile <profile>                  - (Optional) Select between your profiles, by providing a profile name.
-n, --namespace-name <namespaceName> - Namespace name. Example: cat.currency
-h, --namespace-id <namespaceId>     - Namespace id in hexadecimal.

Command

nem2-cli namespace info --namespace-name foo

Owned

Gets all the namespaces owned by an account.

Options

--profile <profile>                  - (Optional) Select between your profiles, by providing a profile name.
-a, --address <address>              - Account address.

Command

nem2-cli namespace owned --address TBULEA-UG2CZQ-ISUR44-2HWA6U-AKGWIX-HDABJV-IPS4

Alias

Gets the mosaic id or address behind an namespace.

Options

--profile <profile> - (Optional) Select between your profiles, by providing a profile name.
-n, --namespace-name <namespaceName> - Namespace name.

Command

nem2-cli namespace alias --namespace-name nem.xem

Transaction

Transactions are signed with the profiles created with nem2-cli profile create, nem2-cli profile import, or nem2-cli account generate -s.

Transaction Info

Returns transaction information given a hash.

Options

--profile <profile> - (Optional) Select between your profiles, by providing a profile name.
-h, --hash <hash>   - Transaction hash.

Command

nem2-cli transaction info --hash AF92D0A1DC40F786DF455A54F3754E6ACBCEC1B590646404B5ACC85403A92690

Transaction Status

Gets the confirmation status of a transaction.

Options

--profile <profile> - (Optional) Select between your profiles, by providing a profile name.
-h, --hash <hash>   - Transaction hash.

Command

nem2-cli transaction status --hash AF92D0A1DC40F786DF455A54F3754E6ACBCEC1B590646404B5ACC85403A92690

AccountLinkTransaction

Delegates the account importance to a proxy account.

Options

--profile <profile>          - (Optional) Select between your profiles, by providing a profile name.
-p, --password <password>    - Profile password.
-f, --max-fee <maxFee>       - Maximum fee (absolute amount).
--sync                       - (Optional) Wait until the server confirms or rejects the transaction.
--announce                   - (Optional) Announce the transaction without double confirmation.
-u, --public-key <publicKey> - Remote account public key.
-a, --action <action>        - Alias action (1: Link, 0: Unlink).

Command

nem2-cli transaction accountlink --public-key 07A87708BF791A69EB715E466935705E7C98141FBA9EB132644C74FBA467B197 --action 1

CosignatureTransaction

Cosigns and announces an AggregateBondedTransaction.

Options

--profile <profile> - (Optional) Select between your profiles, by providing a profile name.
-p, --password <password>    - Profile password.
-h, --hash <hash>   - Aggregate bonded transaction hash to be signed.

Command

nem2-cli transaction cosign --hash A6A374E66B32A3D5133018EFA9CD6E3169C8EEA339F7CCBE29C47D07086E068C

MosaicDefinitionTransaction

Creates a new mosaic.

Options

--profile <profile>               - (Optional) Select between your profiles, by providing a profile name.
-p, --password <password>         - Profile password.
-f, --max-fee <maxFee>            - Maximum fee (absolute amount).
--sync                            - (Optional) Wait until the server confirms or rejects the transaction.
--announce                        - (Optional) Announce the transaction without double confirmation.
-a, --amount <amount>             - Initial supply of mosaics.
-t, --transferable                - (Optional) Mosaic transferable.
-s, --supply-mutable              - (Optional) Mosaic supply mutable.
-r, --restrictable                - (Optional) Mosaic restrictable.
-d, --divisibility <divisibility> - Mosaic divisibility, from 0 to 6.
-u, --duration <duration>         - Mosaic duration in amount of blocks.
-n, --non-expiring                - (Optional) Mosaic non-expiring.

Command

nem2-cli transaction mosaic --amount 1000000 --divisibility 0 --non-expiring --transferable --supply-mutable --restrictable

MosaicSupplyChangeTransaction

Changes a mosaic mosaic.

Options

--profile <profile>        - (Optional) Select between your profiles, by providing a profile name.
-p, --password <password>  - Profile password.
-f, --max-fee <maxFee>     - Maximum fee (absolute amount).
--sync                     - (Optional) Wait until the server confirms or rejects the transaction.
--announce                 - (Optional) Announce the transaction without double confirmation.
-a, --action <action>      - Mosaic supply change action (1: Increase, 0: Decrease).
-m, --mosaic-id <mosaicId> - Mosaic id in hexadecimal format.
-d, --amount <amount>      - Atomic amount of supply change.

Command

nem2-cli transaction mosaicsupplychange --action 1 --mosaic-id 7cdf3b117a3c40cc --delta 1000000

NamespaceRegistrationTransaction

Registers a namespace.

Options

--profile <profile>            - (Optional) Select between your profiles, by providing a profile name.
-p, --password <password>      - Profile password.
-f, --max-fee <maxFee>         - Maximum fee (absolute amount).
--sync                         - (Optional) Wait until the server confirms or rejects the transaction.
--announce                     - (Optional) Announce the transaction without double confirmation.
-n, --name <name>              - Namespace name.
-r, --rootnamespace            - Root namespace.
-s, --subnamespace             - Sub namespace.
-d, --duration <duration>      - Duration (use it with --rootnamespace).
-a, --parent-name <parentName> - Parent namespace name (use it with --subnamespace).

Command

Register a root namespace:

nem2-cli transaction namespace --name foo --rootnamespace --duration 1000

Register a subnamespace:

nem2-cli transaction namespace --subnamespace --parent-name foo --name bar

AddressAliasTransaction

Links a namespace to an address.

Options

--profile <profile>                  - (Optional) Select between your profiles, by providing a profile name.
-p, --password <password>            - Profile password.
-f, --max-fee <maxFee>               - Maximum fee (absolute amount).
--sync                               - (Optional) Wait until the server confirms or rejects the transaction.
--announce                           - (Optional) Announce the transaction without double confirmation.
-a, --action <action>                - Alias action (1: Link, 0: Unlink).
-a, --address <address>              - Account address.
-n, --namespace-name <namespaceName> - Namespace name.

Command

nem2-cli transaction addressalias --action 1 --address TBULEA-UG2CZQ-ISUR44-2HWA6U-AKGWIX-HDABJV-IPS4 --namespace-name foo

MosaicAliasTransaction

Links a namespace to a mosaic.

Options

--profile <profile>                  - (Optional) Select between your profiles, by providing a profile name.
-p, --password <password>            - Profile password.
-f, --max-fee <maxFee>               - Maximum fee (absolute amount).
--sync                               - (Optional) Wait until the server confirms or rejects the transaction.
--announce                           - (Optional) Announce the transaction without double confirmation.
-a, --action <action>                - Alias action (1: Link, 0: Unlink).
-m, --mosaic-id <mosaicId>           - Mosaic id in hexadecimal format.
-n, --namespace-name <namespaceName> - Namespace name.

Command

nem2-cli transaction mosaicalias --action 1 --mosaic 7cdf3b117a3c40cc --namespace-name foo

MultisigModificationAccountTransaction

Create or modify a multisig account.

Note

The command only supports to add or remove one account as a cosignatory at a time.

Options

--profile <profile>                                          - (Optional) Select between your profiles, by providing a profile name.
-p, --password <password>                                    - Profile password.
-f, --max-fee <maxFee>                                       - Maximum fee (absolute amount).
--announce                                                   - (Optional) Announce the transaction without double confirmation.
-F, --max-fee-hash-lock <maxFeeHashLock>                     - Maximum fee (absolute amount) to announce the hash lock transaction.
-D, --duration <duration>                                    - Hash lock duration expressed in blocks. [480]
-L, --amount <amount>                                        - Relative amount of network mosaic to lock. [10]
-R, --min-removal-delta <minRemovalDelta>                    - (Optional) Number of signatures needed to remove a cosignatory.  [0]
-A, --min-approval-delta <minApprovalDelta>                  - (Optional) Number of signatures needed to approve a transaction. [0]
-a, --action <action>                                        - Modification Action (1: Add, 0: Remove).
-p, --cosignatory-public-key <cosignatoryPublicKey>          - Cosignatory accounts public keys (separated by a comma).
-u, --multisig-account-public-key <multisigAccountPublicKey> - Multisig account public key.

Command

nem2-cli transaction multisigmodification --min-approval-delta 1 --min-removal-delta 1 --action 1 --cosignatory-public-key FF8765F86312A79219D7BC2E0E3506A83A0E1D6D46A9C6998749A90E145FC96C --multisig-account-public-key 3AD5E02999457F8DBC645EE1F6316110509CC3E0DC7A6EAD4F84852086278838

SecretLockTransaction

Announces a SecretLockTransaction.

Options

--profile <profile>                        - (Optional) Select between your profiles, by providing a profile name.
-p, --password <password>                  - Profile password.
-f, --max-fee <maxFee>                     - Maximum fee (absolute amount).
--sync                                     - (Optional) Wait until the server confirms or rejects the transaction.
--announce                                 - (Optional) Announce the transaction without double confirmation.
-m, --mosaic-id <mosaicId>                 - Locked mosaic identifier or @alias.
-a, --amount <amount>                      - Amount of mosaic units to lock.
-d, --duration <duration>                  - Number of blocks for which a lock should be valid. Duration is allowed to lie up to 30 days. If reached, the mosaics will be returned to the initiator.
-s, --secret <secret>                      - Proof hashed in hexadecimal format.
-H, --hash-algorithm <hashAlgorithm>       - Algorithm used to hash the proof (0: Op_Sha3_256, 1: Op_Keccak_256, 2: Op_Hash_160, 3: Op_Hash_256).
-r, --recipient-address <recipientAddress> - Address or @alias that receives the funds once unlocked.

Command

nem2-cli transaction secretlock --secret BFD12D3F14460FA9B7CE0B209FCAF37FFFAED56E2925E595ACD569B6D29FA2CF --hash-algorithm Op_Sha3_256 --mosaic-id 0ADA87EF8D08E6C5 --amount 100 --duration 400 --recipient-address SATXKQ-QSWIMT-3S32BA-IEMZXD-P4HHUA-LDEYPL-EAZY

SecretProofTransaction

Announces a SecretProofTransaction.

Options

--profile <profile>                        - (Optional) Select between your profiles, by providing a profile name.
-p, --password <password>                  - Profile password.
-f, --max-fee <maxFee>                     - Maximum fee (absolute amount).
--sync                                     - (Optional) Wait until the server confirms or rejects the transaction.
--announce                                 - (Optional) Announce the transaction without double confirmation.
-s, --secret <secret>                      - Proof hashed in hexadecimal.
-p, --proof <proof>                        - Original random set of bytes in hexadecimal.
-H, --hash-algorithm <hashAlgorithm>       - Algorithm used to hash the proof (0: Op_Sha3_256, 1: Op_Keccak_256, 2: Op_Hash_160, 3: Op_Hash_256).
-r, --recipient-address <recipientAddress> - Address or @alias that receives the funds once unlocked.

Command

nem2-cli transaction secretproof --secret BFD12D3F14460FA9B7CE0B209FCAF37FFFAED56E2925E595ACD569B6D29FA2CF --proof 519548b5cfb82fc2899f --hash-algorithm Op_Sha3_256 --recipient-address SATXKQ-QSWIMT-3S32BA-IEMZXD-P4HHUA-LDEYPL-EAZY

AccountAddressRestrictionTransaction

Allow or block incoming and outgoing transactions for a given a set of addresses.

Options

--profile <profile>                        - (Optional) Select between your profiles, by providing a profile name.
-p, --password <password>                  - Profile password.
-f, --max-fee <maxFee>                     - Maximum fee (absolute amount).
--sync                                     - (Optional) Wait until the server confirms or rejects the transaction.
--announce                                 - (Optional) Announce the transaction without double confirmation.
-f, --flags <flags>                        - Restriction flags.(0: AllowOutgoingAddress, 1: BlockOutgoingAddress, 2: AllowIncomingAddress, 3: BlockIncomingAddress)
-a, --action <action>                      - Modification action. (1: Add, 0: Remove).
-v, --recipient-address <recipientAddress> - Address or @alias to allow/block.

Command

nem2-cli transaction accountaddressrestriction --flags 2 --action 1 --recipient-address TBULEA-UG2CZQ-ISUR44-2HWA6U-AKGWIX-HDABJV-IPS4

AccountMosaicRestrictionTransaction

Allow or block Ann incoming transactions containing a given set of mosaics.

Options

--profile <profile>        - (Optional) Select between your profiles, by providing a profile name.
-p, --password <password>  - Profile password.
-f, --max-fee <maxFee>     - Maximum fee (absolute amount).
--sync                     - (Optional) Wait until the server confirms or rejects the transaction.
--announce                 - (Optional) Announce the transaction without double confirmation.
-f, --flags <flags>        - Restriction flags.(0: AllowMosaic, 1: BlockMosaic)
-a, --action <action>      - Modification action. (1: Add, 0: Remove).
-v, --mosaic-id <mosaicId> - Mosaic or @alias to allow / block.

Command

nem2-cli transaction accountmosaicrestriction --restriction-type 0 --action 1 --mosaic-id 4F2F242FA35763F6

AccountOperationRestrictionTransaction

Allow or block outgoing transactions by transaction type.

Options

--profile <profile>                      - (Optional) Select between your profiles, by providing a profile name.
-p, --password <password>                - Profile password.
-f, --max-fee <maxFee>                   - Maximum fee (absolute amount).
--sync                                   - (Optional) Wait until the server confirms or rejects the transaction.
--announce                               - (Optional) Announce the transaction without double confirmation.
-f, --flags <flags>                      - Restriction flag. (0: AllowOutgoingTransactionType, 1: BlockOutgoingTransactionType)
-a, --action <action>                    - Modification action. (1: Add, 0: Remove).
-v, --transaction-type <transactionType> - Transaction type formatted as hex.

Command

nem2-cli transaction accountoperationrestriction --flags 1 --action 1 --transaction-type 414C

TransferTransaction

Announces a TransferTransaction to an account exchanging value and/or data. For this transaction provide recipient, message and mosaics.

You can send multiple mosaics splitting them with a comma, e.g: @cat.currency::10000000,7cdf3b117a3c40cc::10. The mosaic amount after :: is in absolute value so 1 @cat.currency is 1000000 (divisibility 6).

Options

--profile <profile>                             - (Optional) Select between your profiles, by providing a profile name.
-p, --password <password>                       - Profile password.
-f, --max-fee <maxFee>                          - Maximum fee (absolute amount).
--sync                                          - (Optional) Wait until the server confirms or rejects the transaction.
--announce                                      - (Optional) Announce the transaction without double confirmation.
-r, --recipient-address <recipientAddress>      - Recipient address or @alias.
-m, --message <message>                         - Transaction message.
-c, --mosaics <mosaics>                         - Mosaic to transfer in the format (mosaicId(hex)|@aliasName)::absoluteAmount. Add multiple mosaics with commas.
-e, --encrypted                                 - (Optional) Send an encrypted message. If you set this value, you should set the value of 'recipientPublicKey' as well).
-u, --recipient-public-key <recipientPublicKey> - (Optional) The recipient public key in an encrypted message.
-d, --persistent-harvesting-delegation          - (Optional) Start persistent harvesting delegation.

Command

 nem2-cli transaction transfer --recipient-address TBONKW-COWBZY-ZB2I5J-D3LSDB-QVBYHB-757VN3-SKPP --mosaics @nem.xem::10000000 --message "This is a test message" --sync

Restriction

Get account restrictions

Returns the account restrictions attached to an address.

Options

--profile <profile>     - (Optional) Select between your profiles, by providing a profile name.
-a, --address <address> - Account address

Command

nem2-cli restriction account --address TAEG6L-KWXRA7-PSWUEE-ILQPG4-3V5CYZ-S5652T-JTUU

Get mosaic global restrictions

Returns the global restrictions assigned to a mosaic.

Options

--profile <profile>        - (Optional) Select between your profiles, by providing a profile name.
-m, --mosaic-id <mosaicId> - Mosaic id in hexadecimal format.

Command

nem2-cli restriction mosaicglobal --mosaic-id 634a8ac3fc2b65b3

Get mosaic address restrictions

Returns the mosaic address restrictions assigned to an address.

Options

--profile <profile>        - (Optional) Select between your profiles, by providing a profile name.
-m, --mosaic-id <mosaicId> - Mosaic id in hexadecimal format.
-a, --address <address>    - Account address.

Command

nem2-cli restriction mosaicaddress --mosaic-id 634a8ac3fc2b65b3 --address TBULEA-UG2CZQ-ISUR44-2HWA6U-AKGWIX-HDABJV-IPS4