ValidationApi
public protocol ValidationApi : BaseApi
Undocumented
-
getRequiredSignatures(byTransaction:keys:)
Default implementationThis 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.
-
getPotentialSignatures(byTransaction:)
Default implementationThis 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 implementationVerifies 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. -
verifyAccountAuthority(byReference:keys:)
Default implementationVerifies required signatures of a transaction.
Default Implementation
Declaration
Parameters
ref
Account name or object id.
keys
Signer keys.
Return Value
true
if the signers have enough authority. -
verifyAccountAuthority(byReference:key:)
Default implementationVerifies required signatures of a transaction.
Default Implementation
Declaration
Parameters
ref
Account name or object id.
key
Signer key.
Return Value
true
if the signers have enough authority. -
verifyAccountAuthority(_:)
Default implementationVerifies 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 implementationValidates 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
-
getFees(for:assetId:)
Default implementationGet 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
orString
format.Return Value
Arrray
[AssetAmount]
of fee asset amounts -
getFee(for:assetId:)
Default implementationGet 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
orString
format.Return Value
AssetAmount
fee. -
getFee(forType:assetId:)
Default implementationGet fees for operation type. Not valid for operation per size fees:
- OperationType.proposalCreateOperation
- OperationType.proposalUpdateOperation
- OperationType.withdrawPermissionClaimOperation
- 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
orString
format.Return Value
AssetAmount
fee.