Flow Playground


Recent updates to the Flow Go SDK


Tuesday, January 12th 2021

🛠 Improvements


Friday, January 8th 2021

🛠 Improvements

🐛 Bug Fixes

  • Refresh signer index (#130) @Kay-Zee


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

Emulator v0.10.0 (CLI v0.9.0)Emulator v0.12.0 (CLI v0.11.0)Devnet 17Mainnet 3

🛠 Improvements

  • crypto/cloudkms: Add options parameter to KMS client constructor (#114) @10thfloor
  • client: 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)TestnetMainnet

💥 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.Account struct now contains a Contracts field that maps contractName => contractSource (map[string][]byte). Code is preserved for backwards compatibility.
  • The templates.CreateAccount function has changed to accept a list of contracts rather than a single code parameter. This list allows multiple contracts to be deployed upon account creation.
  • templates.UpdateAccountContract function replaces templates.UpdateAccountCode. This function updates a single contract by name.
  • The templates.AddAccountContract function 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)TestnetMainnet

💥 Breaking Changes

  • Rename AccountKey.ID to AccountKey.Index (#101) @psiemens

⭐ Enhancements

  • Add crypto/cloudkms for Google Cloud KMS transaction signing support (#96, #105) @psiemens @Kay-Zee
  • Add block timestamp field to client.BlockEvents response returned by GetEventsInHeightRange (#100) @janezpodhostnik
  • Add Revoked flag to flow.AccountKey (#101) @psiemens
  • Add crypto.DecodePublicKeyPEM function (#96) @psiemens

Version 0.10.0

Friday, September 18th 2020

Network Compatibility

Emulator v0.7.0Emulator v0.8.0Emulator v0.9.0Emulator v0.10.0TestnetMainnet

💥 Breaking Changes

  • Update onflow/flow/protobuf/go/flow to v0.1.5 (#98) @turbolent

🐛 Bug Fixes

  • Add missing EXPIRED value to flow.TransactionStatus enum (#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.Transaction fields (#91) @turbolent

Version 0.9.0

Monday, August 10th 2020

Network Compatibility

Emulator v0.5.0Emulator v0.6.0Emulator v0.7.0TestnetMainnet

💥 Breaking Changes

Upgrade to Cadence v0.8.0: https://github.com/onflow/cadence/releases/tag/v0.8.0

  • Arguments passed to cadence.Value#WithType are now typed as pointers (*cadence.Type) rather than values (cadence.Type).


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.0Emulator v0.5.0Emulator v0.6.0TestnetMainnet

💥 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.0Emulator v0.5.0TestnetMainnet

💥 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:

  • AddArgument function signature changed to func (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.
  • AddRawArgument function 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.Transaction

The 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

Edit on GitHub