Skip to content

Releases: Soneso/stellar-ios-mac-sdk

Protocol 22 Support

24 Oct 13:58
Compare
Choose a tag to compare

This release adds support for Protocol 22 and maintains backwards compatibility for Protocol 21.

See also: #163

To maintain compatibility for Protocol 21 until Protocol 22 is released you have to consider following braking changes if you are using this version of the SDK:

Horizon:

  • The deprecated fields amount and numAccounts have been removed from AssetResponse

Soroban:

  • The legacy field cost has been removed from SimulateTransactionResponse
  • The createdAt field from TransactionInfo is now a String. It was int before.

Other tips for migrating to Protocol 22:

  • Soroban: The field pagingToken from EventInfo will not be filled any more starting with Protocol 22. Instead, the new field cursor in GetEventsResponse will be filled starting with Protocol 22.
  • Soroban: The new field txHash in GetTransactionResponse and TransactionInfo will be filled starting with Protocol 22.
  • Soroban: You can use the new CreateContractWithConstructorHostFunction class to create contracts that have a constructor.

Async/await support

10 Oct 13:42
Compare
Choose a tag to compare

Async/await support:

  • adds support for async/await (see SE-0296)

Other changes:

  • renamed Walletclass to WalletUtils
  • removed unnecessary throws
  • improved test cases
  • improved documentation

Soroban Contract Parser & SEP imporvements

05 Sep 11:31
Compare
Choose a tag to compare

Soroban Contract Parser

This release adds a soroban contract parser that allows you to access the contract info stored in the contract bytecode.
You can access the environment metadata, contract spec and contract meta.

The environment metadata holds the interface version that should match the version of the soroban environment host functions supported.

The contract spec contains a SCSpecEntryXDR for every function, struct, and union exported by the contract.

In the contract meta, contracts may store any metadata in the entries that can be used by applications and tooling off-network.

You can access the parser directly if you have the contract bytecode:

let byteCode = FileManager.default.contents(atPath: 'path to .wasm file')
let contractInfo = try SorobanContractParser.parseContractByteCode(byteCode: byteCode)

Or you can use SorobanServer methods to load the contract code form the network and parse it.

By contract id:

sorobanServer.getContractInfoForContractId(contractId: contractId) { (response) -> (Void) in
    switch response {
    case .success(let contractInfo):
        // ...
    case .rpcFailure(let error):
        // ...
    case .parsingFailure (let error):
        // ...
    }
}

By wasm id:

sorobanServer.getContractInfoForWasmId(wasmId: wasmId) { (response) -> (Void) in
    switch response {
    case .success(let contractInfo):
        // ...
    case .rpcFailure(let error):
        // ...
    case .parsingFailure (let error):
        // ...
    }
}

The parser returns a SorobanContractInfo object containing the parsed data.
In SorobanParserTest.swift you can find a detailed example of how you can access the parsed data.

SEP improvements

SEP-06: allow extra fields to be added in the deposit and withdrawal requests.
SEP-06: add the new userActionRequired field to the transaction response object.
SEP-24: add the new userActionRequired field to the transaction response object.

Update for Horizon API historical data changes

07 Aug 05:13
Compare
Choose a tag to compare
  • Updated ClaimableBalanceResponse lastModifiedTime parsing. See #162

Horizon v2.31.0 and RPC v21.4.0 updates

25 Jul 11:55
Compare
Choose a tag to compare

Updates for Horizon v2.31.0
(see: #161)

  1. The new Horizon API endpoint: POST /transactions_async has been added.
    It is now covered in the sdk by following new methods:
sdk.transactions.submitAsyncTransaction(transaction:Transaction, ...)
sdk.transactions.submitFeeBumpAsyncTransaction(transaction:FeeBumpTransaction, ...)
sdk.transactions.postTransactionAsync(transactionEnvelope:String, ...)

see also: SubmitTransactionAsyncTestCase.swift

  1. Error schema change: POST /transactions now includes a the hash in its timeout response:

ErrorResponseExtras has been extended. It now provides txHash if the hash is available in the error response.

Updates for RPC v21.4.0
(see: #161)

  • added support for the new endpoints: getTransactions, getFeeStats and getVersionInfo.
  • fixed getEvents pagination options

Update SEP-12 support

  • added the new transaction_idrequest parameter to get and put customer requests.

Soroban improvements

06 Jun 19:04
Compare
Choose a tag to compare

1. Soroban Server improvements:

  • add getAccount and getContractData methods
  • add missing fields type and txHash to EventInfo
  • add useful xdr conversionvalueXdrto EventInfo
  • add missing fields latestLager and oldestLedger to GetHealthResponse
  • add useful xdr conversions transactionEnvelope, transactionResult and transactionMeta to GetTransactionResponse
  • add useful xdr conversions keyXdrValueand valueXdr to LedgerEntry
  • add missing resultErrorXdr field to SendTransactionResponse
  • make costoptional in SimulateTransactionResponse as it has been marked as deprecated in the RPC API docs.
  • make xdr and auth fields not nullable in SimulateTransactionResult

2. TxRep (SEP-11):

  • add soroban support

fix ContractXDR encoding

17 May 20:02
Compare
Choose a tag to compare
  • fixes the encoding of a SCValXDR of type void. Resolves issue #160

Protocol 21 Support

13 May 21:29
Compare
Choose a tag to compare

adds support for protocol 21. see #159

SEP-08 support

29 Apr 12:48
Compare
Choose a tag to compare
  • add SEP-08 Support (Regulated Assets). See doc
  • remove UserDefaults usage in SEP-07. See #158
  • update Soroban RPC args for sendTransaction and getTransaction

Update SEP-06 Support

28 Feb 16:49
Compare
Choose a tag to compare

update SEP-06 to reflect current SEP-06 doc version. See also: SDK doc.