Changelog
Recent updates to the Flow Go SDK
v0.14.0
Friday, January 8th 2021
🛠 Improvements
- Update to Cadence v0.12.1 (#131) @turbolent (also, see the release notes for Cadence v0.12)
🐛 Bug Fixes
- Refresh signer index (#130) @Kay-Zee
v0.14.1
Invalid date
- Synchronize labels from YAML file (#137) @psiemens
- Fix the decoding of Flow type IDs by importing Cadence's type ID decoder (#136) @turbolent
- Storage fees and account minimum balance example (#135) @janezpodhostnik
⭐ Features
- Add transaction decoding (#116) @Kay-Zee
🛠 Improvements
- Add GetAccountAtBlockHeight (#133) @Kay-Zee
Version 0.13.1
Saturday, December 12th 2020
🛠 Improvements
crypto/cloudkms: Add options parameter to KMS client constructor (#114) @10thfloorclient: Add call options parameter to all Access API gRPC client functions (#126) @psiemens- Update to Cadence v0.11.2 (#122) @turbolent
📝 Documentation & Maintenance
- Add Chinese translation of
README.md(#112) @aturX - Add Bastian & Janez as code owners (#123) @psiemens
- Fix broken links in
README.md(#127) @psiemens - Check tidy in CI job (#119) @turbolent
Version 0.12.2
Monday, November 30th 2020
Network Compatibility
| Emulator v0.10.0 (CLI v0.9.0) | Emulator v0.12.0 (CLI v0.11.0) | Testnet | Mainnet |
|---|---|---|---|
| ❌ | ✅ | ✅ | ❌ |
💥 Breaking Changes
Multiple contracts per account (#106)
By @janezpodhostnik
The Flow protocol now supports multiple contracts per account. This SDK has been updated with additional functionality to create and manage multiple contracts on the same account.
- The
flow.Accountstruct now contains aContractsfield that mapscontractName => contractSource(map[string][]byte).Codeis preserved for backwards compatibility. - The
templates.CreateAccountfunction has changed to accept a list of contracts rather than a singlecodeparameter. This list allows multiple contracts to be deployed upon account creation. templates.UpdateAccountContractfunction replacestemplates.UpdateAccountCode. This function updates a single contract by name.- The
templates.AddAccountContractfunction was added, allowing a contract to be deployed to an existing account.
Reduce transaction template size
By @janezpodhostnik
Byte array values ([UInt8]) used in Cadence templates (CreateAccount, UpdateAccountContract, AddAccountContract) are now typed as String and passed as hexadecimal strings. This was done to reduce the size of the accompanying transaction argument values; hexadecimal strings are much more compact in JSON-CDC than array literals.
This is a breaking change because it alters the deterministic template formats, on which some applications may depend.
⭐ Enhancements
- Example and documentation cleanup (#108, #109) @qq976739120
Version 0.11.0
Monday, November 30th 2020
Network Compatibility
| Emulator v0.10.0 (CLI v0.9.0) | Emulator v0.12.0 (CLI v0.11) | Testnet | Mainnet |
|---|---|---|---|
| ✅ | ❌ | ❌ | ✅ |
💥 Breaking Changes
- Rename
AccountKey.IDtoAccountKey.Index(#101) @psiemens
⭐ Enhancements
- Add
crypto/cloudkmsfor Google Cloud KMS transaction signing support (#96, #105) @psiemens @Kay-Zee - Add block timestamp field to
client.BlockEventsresponse returned byGetEventsInHeightRange(#100) @janezpodhostnik - Add
Revokedflag toflow.AccountKey(#101) @psiemens - Add
crypto.DecodePublicKeyPEMfunction (#96) @psiemens
Version 0.10.0
Friday, September 18th 2020
Network Compatibility
| Emulator v0.7.0 | Emulator v0.8.0 | Emulator v0.9.0 | Emulator v0.10.0 | Testnet | Mainnet |
|---|---|---|---|---|---|
| ❌ | ❌ | ✅ | ✅ | ✅ | ✅ |
💥 Breaking Changes
- Update
onflow/flow/protobuf/go/flowto v0.1.5 (#98) @turbolent
🐛 Bug Fixes
- Add missing
EXPIREDvalue toflow.TransactionStatusenum (#90) @rrrkren - Do not deploy empty code string on account creation (#97) @psiemens
⭐ Enhancements
- Add transaction example that uses 2 authorizers (#89) @bjartek
- Improve ECDSA documentation (#94) @tarakby
- Improve documentation for the
flow.Transactionfields (#91) @turbolent
Version 0.9.0
Monday, August 10th 2020
Network Compatibility
| Emulator v0.5.0 | Emulator v0.6.0 | Emulator v0.7.0 | Testnet | Mainnet |
|---|---|---|---|---|
| ❌ | ✅ | ✅ | ✅ | ✅ |
💥 Breaking Changes
Upgrade to Cadence v0.8.0: https://github.com/onflow/cadence/releases/tag/v0.8.0
- Arguments passed to
cadence.Value#WithTypeare now typed as pointers (*cadence.Type) rather than values (cadence.Type).
Example:
myEventType := cadence.EventType{...})
// this 👇
myEvent := cadence.NewEvent(...).WithType(myEventType)
// changes to this 👇
myEvent := cadence.NewEvent(...).WithType(&myEventType)Version 0.8.0
Wednesday, July 15th 2020
Network Compatibility
| Emulator v0.4.0 | Emulator v0.5.0 | Emulator v0.6.0 | Testnet | Mainnet |
|---|---|---|---|---|
| ❌ | ❌ | ✅ | ❌ | ❌ |
💥 Breaking Changes
GetAccountAtLatestBlock (https://github.com/onflow/flow-go-sdk/pull/85)
The GetAccount Access API RPC method has been renamed to GetAccountAtLatestBlock to better reflect its functionality and differentiate it from the upcoming GetAccountAtBlockHeight method.
Version 0.7.0
Wednesday, July 8th 2020
Network Compatibility
| Emulator v0.4.0 | Emulator v0.5.0 | Testnet | Mainnet |
|---|---|---|---|
| ❌ | ✅ | ❌ | ❌ |
💥 Breaking Changes
Transaction arguments (https://github.com/onflow/flow-go-sdk/pull/67)
Due to a bug that was causing transaction arguments to be encoded in an inconsistent manner (https://github.com/onflow/flow-go-sdk/issues/66), the flow.Transaction#Arguments field has been updated to be typed as [][]byte rather than []cadence.Value.
This in turn necessitated a change to the flow.Transaction#AddArgument function:
AddArgumentfunction signature changed tofunc (tx *Transaction) AddArgument(arg cadence.Value) error- This function performs JSON-CDC encoding of the provided argument, and therefore has the potential to produce an error.
AddRawArgumentfunction introduced:func (tx *Transaction) AddRawArgument(arg []byte) *Transaction- This is a chainable function that can be used to add pre-encoded arguments.
Transaction templates (https://github.com/onflow/flow-go-sdk/pull/78)
The helpers defined in the templates package have changed to use parameterized transactions and arguments rather than naive string templates. This approach is more flexible and will allow templates to be easily shared between different SDK implementations.
This change breaks the old API by changing the return type of each template function to *flow.Transaction.
For example, this is the signature for templates.CreateAccount:
// CreateAccount generates a transaction that creates a new account.
//
// This template accepts a list of public keys and a code argument, both of which are optional.
//
// The final argument is the address of the account that will pay the account creation fee.
// This account is added as a transaction authorizer and therefore must sign the resulting transaction.
func CreateAccount(accountKeys []*flow.AccountKey, code []byte, payer flow.Address) *flow.TransactionThe partial transactions returned by these helpers functions can later be signed and sent to the Access API.
Cadence v0.5.0 (https://github.com/onflow/flow-go-sdk/pull/77)
The Go SDK has been upgraded to use the latest Cadence release. Please view the Cadence release notes for an overview of the features and changes introduced in this release: https://github.com/onflow/cadence/releases/tag/v0.5.0
🐛 Bug Fixes
- See transaction arguments change above
⭐ Features
- Added
flow.SignUserMessagefunction to support signing of user messages (https://github.com/onflow/flow-go-sdk/pull/76). Example usage