All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning.
11.0.0 - 2023-03-29
- Muxed accounts and ID memos can be used in the
BuildChallengeTx()
andReadChallengeTx()
SEP-10 utilitiy functions to identify users of shared Stellar accounts. (#4746)BuildChallengeTx()
:- Muxed account addresses can be passed as the
clientAccountID
. - Adds an additional parameter of type
*txnbuild.MemoID
. Memos cannot be specified if theclientAccoutID
id a muxed account address.
- Muxed account addresses can be passed as the
ReadChallengeTx()
:- Muxed account addresses may be returned as the
clientAccountID
. - Adds an additional return value of type
*txnbuild.MemoID
.
- Muxed account addresses may be returned as the
10.0.0 - 2022-04-18
- Adds support for Protocol 19 transaction preconditions (CAP-21).
- There are many new ways for a transaction to be (in)valid (see the new
Preconditions
structure), and the corresponding breaking change is in how transactions are built:
tx, err := NewTransaction(TransactionParams{
SourceAccount: someAccount,
// ... other parameters ...
- Timebounds: NewTimeout(5),
+ Preconditions: Preconditions{TimeBounds: NewTimeout(5)},
})
-
Timebounds
has been renamed toTimeBounds
, though a type alias remains. -
A
*TimeBounds
structure is no longer considered valid (viaValidate()
) if it'snil
. This further reinforces the fact that transactions need timebounds.
9.0.0 - 2022-01-10
- Enable Muxed Accounts (SEP-23) by default (#4169):
- Remove
TransactionParams.EnableMuxedAccounts
- Remove
TransactionFromXDROptionEnableMuxedAccounts
- Remove
FeeBumpTransactionParams.EnableMuxedAccounts
- Remove parameter
withMuxedAccounts bool
from all methods/functions. - Remove
options ...TransactionFromXDROption
parameter fromTransactionFromXDR()
- Rename
SetOpSourceMuxedAccount()
to (pre-existing)SetOpSourceAccount()
which now accepts bothG
andM
(muxed) account strkeys.
- Remove
- Use xdr.Price to represent prices in txnbuild instead of strings (#4167).
8.0.0-beta.0 - 2021-10-04
This release adds support for Protocol 18.
GenericTransaction
,Transaction
, andFeeBumpTransaction
now implementencoding.TextMarshaler
andencoding.TextUnmarshaler
.- New asset structures that conform to the new ChangeTrust and New assets:
- Support for the core liquidity pool XDR types:
LiquidityPoolId
,LiquidityPoolParameters
,LiquidityPoolDeposit
, andLiquidityPoolWithdraw
. - Support for the new asset structures:
ChangeTrustAsset
andTrustLineAsset
.
- There's now a 5-minute grace period to
transaction.ReadChallengeTx
's minimum time bound constraint (#3824). - Assets can now be liquidity pool shares (
AssetTypePoolShare
). - All asset objects can now be converted to the new
ChangeTrustAsset
andTrustLineAsset
objects. - Assets can now be compared in accordance with the protocol, see their respective
LessThan()
implementations.
ChangeTrust
requires aChangeTrustAsset
.RevokeSponsorship
requires aTrustLineAsset
when revoking trustlines.RemoveTrustlineOp
helper now requires aChangeTrustAsset
validate*Asset
helpers now require more-specific asset types.
v7.1.1 - 2021-06-25
- Claimable balance IDs are now precomputed correctly (
Transaction.ClaimableBalanceID(int)
) even when the transaction's source account is a fully-muxed account (#3678). - Fix muxed account address parsing for account merge operation (#3722).
v7.1.0 - 2021-06-01
-
Add
Transaction.SequenceNumber()
helper function to make retrieving the underlying sequence number easier (#3616). -
Add
Transaction.AddSignatureDecorated()
helper function to make attaching decorated signatures to existing transactions easier (#3640).
BaseFee
inTransactionParams
when callingNewTransaction
is allowed to be zero because the fee can be paid by wrapping aTransaction
in aFeeBumpTransaction
(#3622).
v7.0.0 - 2021-05-15
AllowTrustOpAsset
was renamed toAssetCode
,{Must}NewAllowTrustAsset
was renamed to{Must}NewAssetCodeFromString
.- Some methods from the
Operation
interface (BuildXDR()
,FromXDR()
andValidate()
) now take an additionalbool
parameter (withMuxedAccounts
) to indicate whether SEP23 M-strkeys should be enabled.
- Add support for Stellar Protocol 17 (CAP35):
Clawback
,ClawbackClaimableBalance
andSetTrustlineFlags
operations. - Add opt-in support for SEP23 M-strkeys for
MuxedAccount
s:- Some methods from the
Operation
interface (BuildXDR()
,FromXDR()
andValidate()
) now take an additionalbool
parameter (withMuxedAccounts
) - The parameters from
NewFeeBumpTransaction()
andNewTransaction()
now include a new field (EnableMuxedAccounts
) to enable M-strekeys. TransactionFromXDR()
now allows passing aTransactionFromXDROptionEnableMuxedAccounts
option, to enable M-strkey parsing.
- Some methods from the
v6.0.0 - 2021-02-22
- Updates the SEP-10 helper function parameters to support SEP-10 v3.1.
- The following functions added the
webAuthDomain
parameter:BuildChallengeTx()
ReadChallengeTx()
VerifyChallengeTxThreshold()
VerifyChallengeTxSigners()
- The webAuthDomain parameter is verified in the
Read*
andVerify*
functions if it is contained in the challenge transaction, and is ignored if the challenge transaction was generated by an older implementation that does not support the webAuthDomain. - The webAuthDomain parameter is included in challenge transactions generated in the
Build*
function, and the resulting challenge transaction is compatible with SEP-10 v2.1 or greater.
- The following functions added the
- Use strings to represent source accounts in Operation structs (#3393) see example below:
bumpSequenceOp := txnbuild.BumpSequence{BumpTo: 100, SourceAccount: "GB56OJGSA6VHEUFZDX6AL2YDVG2TS5JDZYQJHDYHBDH7PCD5NIQKLSDO"}
- Remove
TxEnvelope()
functions fromTransaction
andFeeBumpTransaction
to simplify the API.ToXDR()
should be used instead ofTxEnvelope()
(#3377)
v5.0.1 - 2021-02-16
- Fix a bug in
ClaimableBalanceID()
where the wrong account was used to derive the claimable balance id (#3406)
v5.0.0 - 2020-11-12
- Updates the SEP-10 helper function parameters and return values to support SEP-10 v3.0
- The following functions replaced the
homeDomain
parameter withhomeDomains
(note: plural):ReadChallengeTx()
VerifyChallengeTxThreshold()
VerifyChallengeTxSigners()
ReadChallengeTx()
now returns a third non-error value:matchedHomeDomain
- The following functions replaced the
v4.2.0 - 2020-11-11
- Add
HashHex()
,SignWithKeyString()
,SignHashX()
, andAddSignatureBase64()
functions back toFeeBumpTransaction
(#3199).
v4.1.0 - 2020-10-16
-
Add helper function
ParseAssetString()
, making it easier to build anAsset
structure from a string in canonical form and check its various properties (#3105). -
Add helper function
Transaction.ClaimableBalanceID()
, making it easier to calculate balance IDs for claimable balances without actually submitting the transaction (#3122). -
Add support for SEP-10 v2.1.0.
- Remove verification of home domain. (Will be reintroduced and changed in a future release.)
- Allow additional manage data operations that have source account as the server key.
v4.0.1 - 2020-10-02
- Fixed bug in
TransactionFromXDR()
which occurs when parsing transaction XDR envelopes which contain Protocol 14 operations.
v4.0.0 - 2020-09-29
Added support for the new operations in Protocol 14. Now it is possible to:
- Create and claim claimable balance operations (see CAP-23) with the
[Create|Claim]ClaimableBalance
structures and their associated helpers - Begin/end sponsoring future reserves for other accounts (see CAP-33) with the
[Begin|End]SponsoringFutureReserves
operations - Revoke sponsorships of various objects with the
RevokeSponsorship
operation (see CAP-33).
Also:
- Added support for Go 1.15.
- Dropped support for Go 1.13.
- Add support for SEP-10 v2.0.0.
- Replace
BuildChallengeTx
'sanchorName
parameter withhomeDomain
. - Add
homeDomain
parameter toReadChallengeTx
,VerifyChallengeTxThreshold
, andVerifyChallengeTxSigners
.
- Replace
v3.2.0 - 2020-06-18
txnbuild
now generates V1 transaction envelopes which are only supported by Protocol 13 (#2640)- Add
ToXDR()
functions forTransaction
andFeeBumpTransaction
instances which return xdr transaction envelopes without errors (#2651)
v3.1.0 - 2020-05-14
- Fix bug which occurs when parsing xdr offers with prices that require more than 7 decimals of precision (#2588)
- Add
AddSignatureBase64
function to bothTransaction
andFeeBumpTransaction
objects for adding a base64-encoded signature. #2586
v3.0.1 - 2020-05-11
- Fix bug which occurs when parsing transactions with manage data operations containing nil values (#2573)
v3.0.0 - 2020-04-28
- The
Account
interface has been extended to includeGetSequenceNumber() (int64, error)
. Also,IncrementSequenceNumber()
now returns an(int64, error)
pair instead of a(xdr.SequenceNumber, error)
pair. - Refactor workflow for creating and signing transactions. Previously, you could create a transaction envelope by populating a
Transaction
instance and calling theBuild()
function on theTransaction
instance.
Transaction
is now an opaque type which has accessor functions like SourceAccount() SimpleAccount
, Memo() Memo
, etc. The motivation behind this change is to make Transaction
more immutable. Here is an example of how to use the new transaction type:
kp := keypair.MustParse("SBPQUZ6G4FZNWFHKUWC5BEYWF6R52E3SEP7R3GWYSM2XTKGF5LNTWW4R")
client := horizonclient.DefaultTestNetClient
ar := horizonclient.AccountRequest{AccountID: kp.Address()}
sourceAccount, err := client.AccountDetail(ar)
check(err)
op := txnbuild.Payment{
Destination: "GCCOBXW2XQNUSL467IEILE6MMCNRR66SSVL4YQADUNYYNUVREF3FIV2Z",
Amount: "10",
Asset: NativeAsset{},
}
tx, err := txnbuild.NewTransaction(
txnbuild.TransactionParams{
SourceAccount: &sourceAccount,
// If IncrementSequenceNum is true, NewTransaction() will call `sourceAccount.IncrementSequenceNumber()`
// to obtain the sequence number for the transaction.
// If IncrementSequenceNum is false, NewTransaction() will call `sourceAccount.GetSequenceNumber()`
// to obtain the sequence number for the transaction.
IncrementSequenceNum: true,
Operations: []Operation{&op},
BaseFee: MinBaseFee,
Timebounds: NewInfiniteTimeout(),
},
)
check(err)
tx, err = tx.Sign(network.TestNetworkPassphrase, kp.(*keypair.Full))
TransactionFromXDR
now has the following signatureTransactionFromXDR(txeB64 string) (*GenericTransaction, error)
. AGenericTransaction
is a container which can be unpacked into either aTransaction
or aFeeBumpTransaction
.BuildChallengeTx
now returns aTransaction
instance instead of the base 64 string encoding of the SEP 10 challenge transaction.VerifyChallengeTx
has been removed. UseVerifyChallengeTxThreshold
orVerifyChallengeTxSigners
instead.
- Add
NewFeeBumpTransaction(params FeeBumpTransactionParams) (*FeeBumpTransaction, error)
function for creating fee bump transactions. Note that fee bump transactions will only be accepted by Stellar Core once Protocol 13 is enabled.
AllowTrust
supports CAP0018 Fine-Grained Control of Authorization by exposing aAuthorizeToMaintainLiabilities
boolean field.ReadChallengeTx
will reject any challenge transactions which are fee bump transactions.ReadChallengeTx
will reject any challenge transactions which contain a MuxedAccount with a memo ID.
- Dropped support for Go 1.12.
v1.5.0 - 2019-10-09
- Dropped support for Go 1.10, 1.11.
- Add support for stellar-core protocol 12, which implements CAP-0024 ("Make PathPayment Symmetrical"). (#1737).
- Deprecated: Following CAP-0024, the operation
txnbuild.PathPayment
is now deprecated in favour oftxnbuild.PathPaymentStrictReceive
, and will be removed in a future release. This is a rename - the new operation behaves identically to the old one. Client code should be updated to use the new operation. - Add: New operation
txnbuild.PathPaymentStrictSend
allows a path payment to be made where the amount sent is specified, and the amount received can vary.
v1.4.0 - 2019-08-09
- Add
BuildChallengeTx
function for building SEP-10 challenge transaction(#1466). - Add
VerifyChallengeTx
method for verifying SEP-10 challenge transaction(#1530). - Add
TransactionFromXDR
function for buildingtxnbuild.Transaction
struct from a base64 XDR transaction envelope#1329. - Fix bug that allowed multiple calls to
Transaction.Build
increment the number of operations in a transaction #1448. - Add
Transaction.SignWithKeyString
helper method for signing transactions using secret keys as strings.(#1564)
v1.3.0 - 2019-07-08
- Add support for getting the hex-encoded transaction hash with
Transaction.HashHex
method. TransactionEnvelope
is now available after building a transaction(Transaction.Build
). Previously, this was only available after signing a transaction. (#1376)- Add support for getting the
TransactionEnvelope
struct withTransaction.TxEnvelope
method (#1415). AllowTrust
operations no longer requires the asset issuer, only asset code is required (#1330).Transaction.SetDefaultFee
method is deprecated and will be removed in the next major release (#1221).Transaction.TransactionFee
method has been added to get the fee that will be paid for a transaction.Transaction.SignHashX
method adds support for signing transactions with hash(x) signature types.
v1.2.0 - 2019-05-16
- In addition to account responses from horizon, transactions and operations can now be built with txnbuild.SimpleAccount structs constructed locally (#1266).
- Added
MaxTrustlineLimit
which represents the maximum value for a trustline limit (#1265). - ChangeTrust operation with no
Limit
field set now defaults toMaxTrustlineLimit
(#1265). - Add support for building
ManageBuyOffer
operation (#1165). - Fix bug in ChangeTrust operation builder (1296).
v1.1.0 - 2019-02-02
- Support for multiple signatures (#1198)
v1.0.0 - 2019-04-26
- Initial release