Skip to content

v3.0.0-alpha.0

Compare
Choose a tag to compare
@abuiles abuiles released this 22 Apr 15:51
· 296 commits to master since this release
81b3a58

This version brings protocol 13 support with backwards compatibility support for protocol 12.

Add

  • Add TransactionBuilder.buildFeeBumpTransaction which makes it easy to create FeeBumpTransaction (#321).
  • Adds a feature flag which allow consumers of this library to create V1 (protocol 13) transactions using the TransactionBuilder (#321).
  • Add support for CAP0027: First-class multiplexed accounts (#325).
  • Add Keypair.xdrMuxedAccount which creates a new xdr.MuxedAccount(#325).
  • Add FeeBumpTransaction which makes it easy to work with fee bump transactions (#328).
  • Add TransactionBuilder.fromXDR which receives an xdr envelope and return a Transaction or FeeBumpTransaction (#328).

Update

  • Update XDR definitions with protocol 13 (#317).
  • Extend Transaction to work with TransactionV1Envelope and TransactionV0Envelope (#317).
  • Add backward compatibility support for CAP0018 (#317).

Breaking changes

  • Transaction.toEnvelope() returns a protocol 13 xdr.TransactionEnvelope which is an xdr.Union (#317).
    If you have code that looks like this transaction.toEnvelope().tx you have two options:

    • You can grab the value wrapped by the union, calling value() like transaction.toEnvelope().value().tx.
    • You can check which is the discriminant by using switch() and then call v0(), v1(), or feeBump().
  • The return value from Transaction.fee changed from number to string. This brings support for Int64 values (#321).

  • The const BASE_FEE changed from number to string (#321).

  • The option fee passed to new TransactionBuilder({fee: ..}) changed from number to string (#321).

  • The following fields, which were previously an xdr.AccountID are now a xdr.MuxedAccount (#325):

    • PaymentOp.destination
    • PathPaymentStrictReceiveOp.destination
    • PathPaymentStrictSendOp.destination
    • Operation.sourceAccount
    • Operation.destination (for ACCOUNT_MERGE)
    • Transaction.sourceAccount
    • FeeBumpTransaction.feeSource

    You can get the string representation by calling StrKey.encodeMuxedAccount which will return a G.. or M.. account.

  • Remove the following deprecated functions (#331):

    • Operation.manageOffer
    • Operation.createPassiveOffer
    • Operation.pathPayment
    • Keypair.fromBase58Seed
  • Remove the Network class (#331).

  • Remove vendor/base58.js (#331).