ValidationApi

public protocol ValidationApi : BaseApi

Undocumented

  • This API will take a partially signed transaction and a set of public keys that the owner has the ability to sign for and return the minimal subset of public keys, that should add signatures to the transaction.

    Default Implementation

    Declaration

    Swift

    func getRequiredSignatures(byTransaction trx: Transaction, keys: [Address]) -> Single<[Address]>

    Parameters

    trx

    Partially signed transaction.

    keys

    Available owner public keys.

    Return Value

    Public keys that should add signatures.

  • This method will return the set of all public keys, that could possibly sign for a given transaction. This call can be used by wallets to filter their set of public keys, to just the relevant subset prior to calling get_required_signatures(), to get the minimum subset.

    Default Implementation

    Declaration

    Swift

    func getPotentialSignatures(byTransaction trx: Transaction) -> Single<[Address]>

    Parameters

    trx

    Unsigned transaction.

    Return Value

    Public keys that can sign transaction.

  • verifyAuthority(byTransaction:) Default implementation

    Verifies required signatures of a transaction.

    Default Implementation

    Declaration

    Swift

    func verifyAuthority(byTransaction trx: Transaction) -> Single<Bool>

    Parameters

    trx

    Signed transaction to verify.

    Return Value

    true if the transaction has all of the required signatures.

  • Verifies required signatures of a transaction.

    Default Implementation

    Declaration

    Swift

    func verifyAccountAuthority(byReference ref: Account.Reference, keys: [Address]) -> Single<Bool>

    Parameters

    ref

    Account name or object id.

    keys

    Signer keys.

    Return Value

    true if the signers have enough authority.

  • Verifies required signatures of a transaction.

    Default Implementation

    Declaration

    Swift

    func verifyAccountAuthority(byReference ref: Account.Reference, key: Address) -> Single<Bool>

    Parameters

    ref

    Account name or object id.

    key

    Signer key.

    Return Value

    true if the signers have enough authority.

  • verifyAccountAuthority(_:) Default implementation

    Verifies required signatures of a transaction.

    Default Implementation

    Declaration

    Swift

    func verifyAccountAuthority(_ credentials: Credentials) -> Single<Bool>

    Parameters

    credentials

    Account credentials.

    Return Value

    true if the signers have enough authority.

  • validate(byTransaction:) Default implementation

    Validates a transaction against the current state without broadcasting it on the network.

    Throws

    DCoreException, if not valid.

    Default Implementation

    Declaration

    Swift

    func validate(byTransaction trx: Transaction) -> Single<ProcessedTransaction>

    Parameters

    trx

    Signed transaction.

    Return Value

    ProcessedTransaction.

  • getFees(for:assetId:) Default implementation

    Get fees for operations.

    Default Implementation

    Declaration

    Swift

    func getFees(for operations: [Operation], assetId: AssetObjectIdConvertible) -> Single<[AssetAmount]>

    Parameters

    operations

    List of operations.

    assetId

    Asset id eg. DCT id is 1.3.0, as AssetObjectId or String format.

    Return Value

    Arrray [AssetAmount] of fee asset amounts

  • getFee(for:assetId:) Default implementation

    Get fees for operation.

    Default Implementation

    Declaration

    Swift

    func getFee(for operation: Operation, assetId: AssetObjectIdConvertible) -> Single<AssetAmount>

    Parameters

    operation

    Operation.

    assetId

    Asset id eg. DCT id is 1.3.0, as AssetObjectId or String format.

    Return Value

    AssetAmount fee.

  • getFee(forType:assetId:) Default implementation

    Get fees for operation type. Not valid for operation per size fees:

    1. OperationType.proposalCreateOperation
    2. OperationType.proposalUpdateOperation
    3. OperationType.withdrawPermissionClaimOperation
    4. OperationType.customOperation

    Default Implementation

    Declaration

    Swift

    func getFee(forType type: OperationType, assetId: AssetObjectIdConvertible) -> Single<AssetAmount>

    Parameters

    type

    Operation type.

    assetId

    Asset id eg. DCT id is 1.3.0, as AssetObjectId or String format.

    Return Value

    AssetAmount fee.