Skip to content

Commit

Permalink
add soroban support to txRep (sep-11)
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-rogobete committed Jun 5, 2024
1 parent 403b9b5 commit 038615e
Show file tree
Hide file tree
Showing 5 changed files with 962 additions and 1,196 deletions.
4 changes: 4 additions & 0 deletions stellarsdk/stellarsdk/responses/xdr/LedgerKeyXDR.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ public struct LiquidityPoolIDXDR: XDRCodable {
liquidityPoolID = try container.decode(WrappedData32.self)
}

public init(id: WrappedData32) {
liquidityPoolID = id
}

public func encode(to encoder: Encoder) throws {
var container = encoder.unkeyedContainer()
try container.encode(liquidityPoolID)
Expand Down
16 changes: 16 additions & 0 deletions stellarsdk/stellarsdk/responses/xdr/TransactionEnvelopeXDR.swift
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,22 @@ public enum TransactionEnvelopeXDR: XDRCodable {
}
}

public var txExt: TransactionExtXDR? {
get {
switch self {
case .v0(let tev0):
return nil
case .v1(let tev1):
return tev1.tx.ext
case .feeBump(let tevf):
switch tevf.tx.innerTx {
case .v1(let tev1):
return tev1.tx.ext
}
}
}
}

public var txSignatures: [DecoratedSignatureXDR] {
get {
switch self {
Expand Down
2 changes: 1 addition & 1 deletion stellarsdk/stellarsdk/responses/xdr/TransactionXDR.swift
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ public enum TransactionExtXDR : XDRCodable {
}
}

private func type() -> Int32 {
public func type() -> Int32 {
switch self {
case .void: return 0
case .sorobanTransactionData:return 1
Expand Down
Loading

0 comments on commit 038615e

Please sign in to comment.