Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grape update #683

Merged
merged 8 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/radixdlt/swift-engine-toolkit",
"state" : {
"revision" : "18a46a297894aef8ea0dcfb03877a6d56e2842f4",
"version" : "0.12.0-fig.1-f6c4402"
"branch" : "release/grape",
"revision" : "41786c2d4cee1a4306ede7d4f33bbc37520046b8"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ package.addModules([
dependencies: [
"Cryptography",
.product(name: "EngineToolkit", package: "swift-engine-toolkit") {
.package(url: "https://github.com/radixdlt/swift-engine-toolkit", exact: "0.12.0-fig.1-f6c4402")
.package(url: "https://github.com/radixdlt/swift-engine-toolkit", branch: "release/grape")
},
],
tests: .no
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ public struct CommittedTransactionInfo: Codable, Hashable {
public private(set) var round: Int64
public private(set) var roundTimestamp: String
public private(set) var transactionStatus: TransactionStatus
/** Hex-encoded SHA-256 hash. */
public private(set) var payloadHashHex: String?
/** Hex-encoded SHA-256 hash. */
public private(set) var intentHashHex: String?
/** Bech32m-encoded hash. */
public private(set) var payloadHash: String?
/** Bech32m-encoded hash. */
public private(set) var intentHash: String?
/** String-encoded decimal representing the amount of a related fungible resource. */
public private(set) var feePaid: String?
public private(set) var affectedGlobalEntities: [String]?
Expand All @@ -34,24 +34,24 @@ public struct CommittedTransactionInfo: Codable, Hashable {
/** Hex-encoded binary blob. */
public private(set) var rawHex: String?
public private(set) var receipt: TransactionReceipt?
/** Hex-encoded binary blob. */
public private(set) var messageHex: String?
/** defined in core api specs. */
public private(set) var message: AnyCodable?

public init(stateVersion: Int64, epoch: Int64, round: Int64, roundTimestamp: String, transactionStatus: TransactionStatus, payloadHashHex: String? = nil, intentHashHex: String? = nil, feePaid: String? = nil, affectedGlobalEntities: [String]? = nil, confirmedAt: Date? = nil, errorMessage: String? = nil, rawHex: String? = nil, receipt: TransactionReceipt? = nil, messageHex: String? = nil) {
public init(stateVersion: Int64, epoch: Int64, round: Int64, roundTimestamp: String, transactionStatus: TransactionStatus, payloadHash: String? = nil, intentHash: String? = nil, feePaid: String? = nil, affectedGlobalEntities: [String]? = nil, confirmedAt: Date? = nil, errorMessage: String? = nil, rawHex: String? = nil, receipt: TransactionReceipt? = nil, message: AnyCodable? = nil) {
self.stateVersion = stateVersion
self.epoch = epoch
self.round = round
self.roundTimestamp = roundTimestamp
self.transactionStatus = transactionStatus
self.payloadHashHex = payloadHashHex
self.intentHashHex = intentHashHex
self.payloadHash = payloadHash
self.intentHash = intentHash
self.feePaid = feePaid
self.affectedGlobalEntities = affectedGlobalEntities
self.confirmedAt = confirmedAt
self.errorMessage = errorMessage
self.rawHex = rawHex
self.receipt = receipt
self.messageHex = messageHex
self.message = message
}

public enum CodingKeys: String, CodingKey, CaseIterable {
Expand All @@ -60,15 +60,15 @@ public struct CommittedTransactionInfo: Codable, Hashable {
case round
case roundTimestamp = "round_timestamp"
case transactionStatus = "transaction_status"
case payloadHashHex = "payload_hash_hex"
case intentHashHex = "intent_hash_hex"
case payloadHash = "payload_hash"
case intentHash = "intent_hash"
case feePaid = "fee_paid"
case affectedGlobalEntities = "affected_global_entities"
case confirmedAt = "confirmed_at"
case errorMessage = "error_message"
case rawHex = "raw_hex"
case receipt
case messageHex = "message_hex"
case message
}

// Encodable protocol methods
Expand All @@ -80,15 +80,15 @@ public struct CommittedTransactionInfo: Codable, Hashable {
try container.encode(round, forKey: .round)
try container.encode(roundTimestamp, forKey: .roundTimestamp)
try container.encode(transactionStatus, forKey: .transactionStatus)
try container.encodeIfPresent(payloadHashHex, forKey: .payloadHashHex)
try container.encodeIfPresent(intentHashHex, forKey: .intentHashHex)
try container.encodeIfPresent(payloadHash, forKey: .payloadHash)
try container.encodeIfPresent(intentHash, forKey: .intentHash)
try container.encodeIfPresent(feePaid, forKey: .feePaid)
try container.encodeIfPresent(affectedGlobalEntities, forKey: .affectedGlobalEntities)
try container.encodeIfPresent(confirmedAt, forKey: .confirmedAt)
try container.encodeIfPresent(errorMessage, forKey: .errorMessage)
try container.encodeIfPresent(rawHex, forKey: .rawHex)
try container.encodeIfPresent(receipt, forKey: .receipt)
try container.encodeIfPresent(messageHex, forKey: .messageHex)
try container.encodeIfPresent(message, forKey: .message)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ public struct StreamTransactionsRequest: Codable, Hashable {
public private(set) var eventsFilter: [StreamTransactionsRequestEventFilterItem]?
/** Configures the order of returned result set. Defaults to `desc`. */
public private(set) var order: Order?
public private(set) var optIns: TransactionCommittedDetailsOptIns?
public private(set) var optIns: TransactionDetailsOptIns?

public init(atLedgerState: LedgerStateSelector? = nil, cursor: String? = nil, limitPerPage: Int? = nil, fromLedgerState: LedgerStateSelector? = nil, kindFilter: KindFilter? = nil, manifestAccountsWithdrawnFromFilter: [String]? = nil, manifestAccountsDepositedIntoFilter: [String]? = nil, manifestResourcesFilter: [String]? = nil, affectedGlobalEntitiesFilter: [String]? = nil, eventsFilter: [StreamTransactionsRequestEventFilterItem]? = nil, order: Order? = nil, optIns: TransactionCommittedDetailsOptIns? = nil) {
public init(atLedgerState: LedgerStateSelector? = nil, cursor: String? = nil, limitPerPage: Int? = nil, fromLedgerState: LedgerStateSelector? = nil, kindFilter: KindFilter? = nil, manifestAccountsWithdrawnFromFilter: [String]? = nil, manifestAccountsDepositedIntoFilter: [String]? = nil, manifestResourcesFilter: [String]? = nil, affectedGlobalEntitiesFilter: [String]? = nil, eventsFilter: [StreamTransactionsRequestEventFilterItem]? = nil, order: Order? = nil, optIns: TransactionDetailsOptIns? = nil) {
self.atLedgerState = atLedgerState
self.cursor = cursor
self.limitPerPage = limitPerPage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ public struct StreamTransactionsRequestAllOf: Codable, Hashable {
public private(set) var eventsFilter: [StreamTransactionsRequestEventFilterItem]?
/** Configures the order of returned result set. Defaults to `desc`. */
public private(set) var order: Order?
public private(set) var optIns: TransactionCommittedDetailsOptIns?
public private(set) var optIns: TransactionDetailsOptIns?

public init(fromLedgerState: LedgerStateSelector? = nil, kindFilter: KindFilter? = nil, manifestAccountsWithdrawnFromFilter: [String]? = nil, manifestAccountsDepositedIntoFilter: [String]? = nil, manifestResourcesFilter: [String]? = nil, affectedGlobalEntitiesFilter: [String]? = nil, eventsFilter: [StreamTransactionsRequestEventFilterItem]? = nil, order: Order? = nil, optIns: TransactionCommittedDetailsOptIns? = nil) {
public init(fromLedgerState: LedgerStateSelector? = nil, kindFilter: KindFilter? = nil, manifestAccountsWithdrawnFromFilter: [String]? = nil, manifestAccountsDepositedIntoFilter: [String]? = nil, manifestResourcesFilter: [String]? = nil, affectedGlobalEntitiesFilter: [String]? = nil, eventsFilter: [StreamTransactionsRequestEventFilterItem]? = nil, order: Order? = nil, optIns: TransactionDetailsOptIns? = nil) {
self.fromLedgerState = fromLedgerState
self.kindFilter = kindFilter
self.manifestAccountsWithdrawnFromFilter = manifestAccountsWithdrawnFromFilter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ extension GatewayAPI {
public struct TransactionCommittedDetailsRequest: Codable, Hashable {

public private(set) var atLedgerState: LedgerStateSelector?
/** Hex-encoded SHA-256 hash. */
public private(set) var intentHashHex: String
public private(set) var optIns: TransactionCommittedDetailsOptIns?
/** Bech32m-encoded hash. */
public private(set) var intentHash: String
public private(set) var optIns: TransactionDetailsOptIns?

public init(atLedgerState: LedgerStateSelector? = nil, intentHashHex: String, optIns: TransactionCommittedDetailsOptIns? = nil) {
public init(atLedgerState: LedgerStateSelector? = nil, intentHash: String, optIns: TransactionDetailsOptIns? = nil) {
self.atLedgerState = atLedgerState
self.intentHashHex = intentHashHex
self.intentHash = intentHash
self.optIns = optIns
}

public enum CodingKeys: String, CodingKey, CaseIterable {
case atLedgerState = "at_ledger_state"
case intentHashHex = "intent_hash_hex"
case intentHash = "intent_hash"
case optIns = "opt_ins"
}

Expand All @@ -39,7 +39,7 @@ public struct TransactionCommittedDetailsRequest: Codable, Hashable {
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encodeIfPresent(atLedgerState, forKey: .atLedgerState)
try container.encode(intentHashHex, forKey: .intentHashHex)
try container.encode(intentHash, forKey: .intentHash)
try container.encodeIfPresent(optIns, forKey: .optIns)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,25 @@ extension GatewayAPI {

public struct TransactionCommittedDetailsRequestAllOf: Codable, Hashable {

/** Hex-encoded SHA-256 hash. */
public private(set) var intentHashHex: String
public private(set) var optIns: TransactionCommittedDetailsOptIns?
/** Bech32m-encoded hash. */
public private(set) var intentHash: String
public private(set) var optIns: TransactionDetailsOptIns?

public init(intentHashHex: String, optIns: TransactionCommittedDetailsOptIns? = nil) {
self.intentHashHex = intentHashHex
public init(intentHash: String, optIns: TransactionDetailsOptIns? = nil) {
self.intentHash = intentHash
self.optIns = optIns
}

public enum CodingKeys: String, CodingKey, CaseIterable {
case intentHashHex = "intent_hash_hex"
case intentHash = "intent_hash"
case optIns = "opt_ins"
}

// Encodable protocol methods

public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(intentHashHex, forKey: .intentHashHex)
try container.encode(intentHash, forKey: .intentHash)
try container.encodeIfPresent(optIns, forKey: .optIns)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// TransactionCommittedDetailsOptIns.swift
// TransactionDetailsOptIns.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
Expand All @@ -10,23 +10,29 @@ import Foundation
import AnyCodable
#endif

@available(*, deprecated, renamed: "GatewayAPI.TransactionCommittedDetailsOptIns")
public typealias TransactionCommittedDetailsOptIns = GatewayAPI.TransactionCommittedDetailsOptIns
@available(*, deprecated, renamed: "GatewayAPI.TransactionDetailsOptIns")
public typealias TransactionDetailsOptIns = GatewayAPI.TransactionDetailsOptIns

extension GatewayAPI {

public struct TransactionCommittedDetailsOptIns: Codable, Hashable {
public struct TransactionDetailsOptIns: Codable, Hashable {

public private(set) var rawHex: Bool?
public private(set) var receiptStateChanges: Bool?
public private(set) var receiptFeeSummary: Bool?
public private(set) var receiptFeeSource: Bool?
public private(set) var receiptFeeDestination: Bool?
public private(set) var receiptCostingParameters: Bool?
public private(set) var receiptEvents: Bool?
public private(set) var affectedGlobalEntities: Bool?

public init(rawHex: Bool? = nil, receiptStateChanges: Bool? = nil, receiptFeeSummary: Bool? = nil, receiptEvents: Bool? = nil, affectedGlobalEntities: Bool? = nil) {
public init(rawHex: Bool? = nil, receiptStateChanges: Bool? = nil, receiptFeeSummary: Bool? = nil, receiptFeeSource: Bool? = nil, receiptFeeDestination: Bool? = nil, receiptCostingParameters: Bool? = nil, receiptEvents: Bool? = nil, affectedGlobalEntities: Bool? = nil) {
self.rawHex = rawHex
self.receiptStateChanges = receiptStateChanges
self.receiptFeeSummary = receiptFeeSummary
self.receiptFeeSource = receiptFeeSource
self.receiptFeeDestination = receiptFeeDestination
self.receiptCostingParameters = receiptCostingParameters
self.receiptEvents = receiptEvents
self.affectedGlobalEntities = affectedGlobalEntities
}
Expand All @@ -35,6 +41,9 @@ public struct TransactionCommittedDetailsOptIns: Codable, Hashable {
case rawHex = "raw_hex"
case receiptStateChanges = "receipt_state_changes"
case receiptFeeSummary = "receipt_fee_summary"
case receiptFeeSource = "receipt_fee_source"
case receiptFeeDestination = "receipt_fee_destination"
case receiptCostingParameters = "receipt_costing_parameters"
case receiptEvents = "receipt_events"
case affectedGlobalEntities = "affected_global_entities"
}
Expand All @@ -46,6 +55,9 @@ public struct TransactionCommittedDetailsOptIns: Codable, Hashable {
try container.encodeIfPresent(rawHex, forKey: .rawHex)
try container.encodeIfPresent(receiptStateChanges, forKey: .receiptStateChanges)
try container.encodeIfPresent(receiptFeeSummary, forKey: .receiptFeeSummary)
try container.encodeIfPresent(receiptFeeSource, forKey: .receiptFeeSource)
try container.encodeIfPresent(receiptFeeDestination, forKey: .receiptFeeDestination)
try container.encodeIfPresent(receiptCostingParameters, forKey: .receiptCostingParameters)
try container.encodeIfPresent(receiptEvents, forKey: .receiptEvents)
try container.encodeIfPresent(affectedGlobalEntities, forKey: .affectedGlobalEntities)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,25 @@ public struct TransactionNotFoundError: Codable, Hashable {

/** The type of error. Each subtype may have its own additional structured fields. */
public private(set) var type: String
/** Hex-encoded SHA-256 hash. */
public private(set) var intentHashHex: String
/** Bech32m-encoded hash. */
public private(set) var intentHash: String

public init(type: String, intentHashHex: String) {
public init(type: String, intentHash: String) {
self.type = type
self.intentHashHex = intentHashHex
self.intentHash = intentHash
}

public enum CodingKeys: String, CodingKey, CaseIterable {
case type
case intentHashHex = "intent_hash_hex"
case intentHash = "intent_hash"
}

// Encodable protocol methods

public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(type, forKey: .type)
try container.encode(intentHashHex, forKey: .intentHashHex)
try container.encode(intentHash, forKey: .intentHash)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ public struct TransactionReceipt: Codable, Hashable {
public private(set) var status: TransactionReceiptStatus?
/** Fees paid, Only present if the `status` is not `Rejected`. */
public private(set) var feeSummary: AnyCodable?
public private(set) var costingParameters: AnyCodable?
/** Only present if the `status` is not `Rejected`. */
public private(set) var feeDestination: AnyCodable?
/** Only present if the `status` is not `Rejected`. */
public private(set) var feeSource: AnyCodable?
/** Transaction state updates (only present if status is Succeeded or Failed). */
public private(set) var stateUpdates: AnyCodable?
/** Information (number and active validator list) about new epoch if occured. */
Expand All @@ -32,9 +37,12 @@ public struct TransactionReceipt: Codable, Hashable {
/** Error message (only present if status is `Failed` or `Rejected`) */
public private(set) var errorMessage: String?

public init(status: TransactionReceiptStatus? = nil, feeSummary: AnyCodable? = nil, stateUpdates: AnyCodable? = nil, nextEpoch: AnyCodable? = nil, output: AnyCodable? = nil, events: AnyCodable? = nil, errorMessage: String? = nil) {
public init(status: TransactionReceiptStatus? = nil, feeSummary: AnyCodable? = nil, costingParameters: AnyCodable? = nil, feeDestination: AnyCodable? = nil, feeSource: AnyCodable? = nil, stateUpdates: AnyCodable? = nil, nextEpoch: AnyCodable? = nil, output: AnyCodable? = nil, events: AnyCodable? = nil, errorMessage: String? = nil) {
self.status = status
self.feeSummary = feeSummary
self.costingParameters = costingParameters
self.feeDestination = feeDestination
self.feeSource = feeSource
self.stateUpdates = stateUpdates
self.nextEpoch = nextEpoch
self.output = output
Expand All @@ -45,6 +53,9 @@ public struct TransactionReceipt: Codable, Hashable {
public enum CodingKeys: String, CodingKey, CaseIterable {
case status
case feeSummary = "fee_summary"
case costingParameters = "costing_parameters"
case feeDestination = "fee_destination"
case feeSource = "fee_source"
case stateUpdates = "state_updates"
case nextEpoch = "next_epoch"
case output
Expand All @@ -58,6 +69,9 @@ public struct TransactionReceipt: Codable, Hashable {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encodeIfPresent(status, forKey: .status)
try container.encodeIfPresent(feeSummary, forKey: .feeSummary)
try container.encodeIfPresent(costingParameters, forKey: .costingParameters)
try container.encodeIfPresent(feeDestination, forKey: .feeDestination)
try container.encodeIfPresent(feeSource, forKey: .feeSource)
try container.encodeIfPresent(stateUpdates, forKey: .stateUpdates)
try container.encodeIfPresent(nextEpoch, forKey: .nextEpoch)
try container.encodeIfPresent(output, forKey: .output)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@ extension GatewayAPI {

public struct TransactionStatusRequest: Codable, Hashable {

/** Hex-encoded SHA-256 hash. */
public private(set) var intentHashHex: String
/** Bech32m-encoded hash. */
public private(set) var intentHash: String

public init(intentHashHex: String) {
self.intentHashHex = intentHashHex
public init(intentHash: String) {
self.intentHash = intentHash
}

public enum CodingKeys: String, CodingKey, CaseIterable {
case intentHashHex = "intent_hash_hex"
case intentHash = "intent_hash"
}

// Encodable protocol methods

public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(intentHashHex, forKey: .intentHashHex)
try container.encode(intentHash, forKey: .intentHash)
}
}

Expand Down
Loading
Loading