release-notes-v18
⬆️ Install or Upgrade
Follow the Flow CLI installation guide for instructions on how to install or upgrade the CLI.
⭐ Features
Resolve Contract Imports in Scripts and Transactions
This is a new feature that allows you to send transactions and scripts that reference
contracts deployed using the project deploy command. Imports are resolved
by matching contract source paths to their declarations in flow.json.
For example:
Example script: get_supply.cdc
_10import Kibble from "../../contracts/Kibble.cdc"_10_10pub fun main(): UFix64 {_10    let supply = Kibble.totalSupply_10    return supply_10}
Example command:
_10flow scripts execute ./get_supply.cdc
Note: Please make sure you first deploy the contract using flow project deploy
command and that contracts are correctly added to the flow configuration.
Build, Sign and Send Transactions
New functionality allows you to build a transaction, sign it and send signed to the network in separated steps.
Build Transaction
Build new transaction and specify who will be the proposer, signer and payer account or address. Example:
_10flow transactions build ./transaction.cdc --proposer alice --payer bob --authorizer bob --filter payload --save payload1.rlp
Check more about this functionality in docs.
Sign Transaction
After using build command and saving payload to a file you should sign the transaction with each account. Example:
_10flow transactions sign ./payload1.rlp --signer alice --filter payload --save payload2.rlp
Send Signed Transaction
When authorizer, payer and proposer sign the transaction it is ready to be
sent to the network. Anyone can execute the send-signed command. Example:
_10flow transactions send-signed ./payload3.rlp
Version Check
Automatically checks if a new version exists and outputs a warning in case there is a newer version. Example:
_10⚠️  Version Warning: New version v0.18.0 of Flow CLI is available._10Follow the Flow [CLI installation guide](../install.md) for instructions on how to install or upgrade the CLI
Create Account With Multiple Keys and Weights
Account creation can be done using multiple keys (--key) and new --key-weight
flag. Flag enables you to set key weight for each of the keys. Command example:
_24accounts create \_24    --key ca8cc7...76f67 --key-weight 500 \_24    --key da8123...043ce --key-weight 500_24_24Address	 0x179b6b1cb6755e31_24Balance	 0.10000000_24Keys	 2_24_24Key 0	Public Key		 ca8cc7...76f67_24	Weight			 500_24	Signature Algorithm	 ECDSA_P256_24	Hash Algorithm		 SHA3_256_24	Revoked 		 false_24	Sequence Number 	 0_24	Index 			 0_24_24_24Key 1	Public Key		 da8123...043ce_24	Weight			 500_24	Signature Algorithm	 ECDSA_P256_24	Hash Algorithm		 SHA3_256_24	Revoked 		 false_24	Sequence Number 	 0_24	Index 			 1
🎉 Improvements
Account Response Improved
Account response includes two new fields in key section: Sequence Number and Index.
Transaction Result Improved
Transaction result displays more information about the transaction. New format example:
_42Status		✅ SEALED_42ID		b6430b35ba23849a8acb4fa1a4a1d5cce3ed4589111ecbb3984de1b6bd1ba39e_42Payer		a2c4941b5f3c7151_42Authorizers	[a2c4941b5f3c7151]_42_42Proposal Key:	_42    Address	a2c4941b5f3c7151_42    Index	0_42    Sequence	9_42_42No Payload Signatures_42_42Envelope Signature 0:_42    Address	a2c4941b5f3c7151_42    Signature	5391a6fed0fe...2742048166f9d5c925a8dcb78a6d8c710921d67_42    Key Index	0_42_42_42Events:	 None_42_42_42Arguments (1):_42    - Argument 0: {"type":"String","value":"Meow"}_42_42_42Code_42_42transaction(greeting: String) {_42  let guest: Address_42_42  prepare(authorizer: AuthAccount) {_42    self.guest = authorizer.address_42  }_42_42  execute {_42    log(greeting.concat(",").concat(self.guest.toString()))_42  }_42}_42_42_42Payload:_42f90184f90138...8a9462751237da2742048166f9d5c925a8dcb78a6d8c710921d67
Transaction error is now shown at the top of the result.
_18Transaction 0dd6294a7614bc0fbeb39b44a6e9f68e821225caa4baf4104a17dc1193d4f011 sealed_18_18Status: SEALED_18Execution Error: Execution failed:_18error: invalid move operation for non-resource_18  --> 0dd6294a7614bc0fbeb39b44a6e9f68e821225caa4baf4104a17dc1193d4f011:15:15_18   |_1815 |         useRes(<-result)_18   |                ^^^ unexpected `<-`_18_18error: mismatched types_18  --> 0dd6294a7614bc0fbeb39b44a6e9f68e821225caa4baf4104a17dc1193d4f011:15:15_18   |_1815 |         useRes(<-result)_18   |                ^^^^^^^^ expected `AnyResource`, got `&AnyResource`_18_18Events:_18  None
🐞 Bug Fixes
New Transaction ID Log
While sending transaction was in progress output displayed wrong transaction ID.
Init Reset Fix
Old configuration format caused an error saying to reset the configuration using reset flag, but when ran it produced the same error again. This bug was fixed.
Emulator Config Path
When running emulator command flow emulator config flag -f was ignored.
This has been fixed, so you can provide a custom path to the config while running
the start emulator command.