Releases: Soneso/stellar-ios-mac-sdk
Protocol 22 Support
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
andnumAccounts
have been removed fromAssetResponse
Soroban:
- The legacy field
cost
has been removed fromSimulateTransactionResponse
- The
createdAt
field fromTransactionInfo
is now aString
. It wasint
before.
Other tips for migrating to Protocol 22:
- Soroban: The field
pagingToken
fromEventInfo
will not be filled any more starting with Protocol 22. Instead, the new fieldcursor
inGetEventsResponse
will be filled starting with Protocol 22. - Soroban: The new field
txHash
inGetTransactionResponse
andTransactionInfo
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
Async/await support:
- adds support for async/await (see SE-0296)
Other changes:
- renamed
Wallet
class toWalletUtils
- removed unnecessary throws
- improved test cases
- improved documentation
Soroban Contract Parser & SEP imporvements
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
- Updated ClaimableBalanceResponse lastModifiedTime parsing. See #162
Horizon v2.31.0 and RPC v21.4.0 updates
Updates for Horizon v2.31.0
(see: #161)
- 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
- 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
andgetVersionInfo
. - fixed
getEvents
pagination options
Update SEP-12 support
- added the new
transaction_id
request parameter to get and put customer requests.
Soroban improvements
1. Soroban Server improvements:
- add
getAccount
andgetContractData
methods - add missing fields
type
andtxHash
toEventInfo
- add useful xdr conversion
valueXdr
toEventInfo
- add missing fields
latestLager
andoldestLedger
toGetHealthResponse
- add useful xdr conversions
transactionEnvelope
,transactionResult
andtransactionMeta
toGetTransactionResponse
- add useful xdr conversions
keyXdrValue
andvalueXdr
to LedgerEntry - add missing
resultErrorXdr
field toSendTransactionResponse
- make
cost
optional inSimulateTransactionResponse
as it has been marked as deprecated in the RPC API docs. - make
xdr
andauth
fields not nullable inSimulateTransactionResult
2. TxRep (SEP-11):
- add soroban support
fix ContractXDR encoding
- fixes the encoding of a SCValXDR of type void. Resolves issue #160
Protocol 21 Support
adds support for protocol 21. see #159
SEP-08 support
Update SEP-06 Support
update SEP-06 to reflect current SEP-06 doc version. See also: SDK doc.