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
trxPartially signed transaction.
keysAvailable 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
trxUnsigned 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
trxSigned transaction to verify.
Return Value
trueif the transaction has all of the required signatures. -
verifyAccountAuthority(byReference:keys:)Default implementationVerifies required signatures of a transaction.
Default Implementation
Declaration
Parameters
refAccount name or object id.
keysSigner keys.
Return Value
trueif the signers have enough authority. -
verifyAccountAuthority(byReference:key:)Default implementationVerifies required signatures of a transaction.
Default Implementation
Declaration
Parameters
refAccount name or object id.
keySigner key.
Return Value
trueif the signers have enough authority. -
verifyAccountAuthority(_:)Default implementationVerifies required signatures of a transaction.
Default Implementation
Declaration
Swift
func verifyAccountAuthority(_ credentials: Credentials) -> Single<Bool>Parameters
credentialsAccount credentials.
Return Value
trueif 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
trxSigned 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
operationsList of operations.
assetIdAsset id eg. DCT id is 1.3.0, as
AssetObjectIdorStringformat.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
operationOperation.
assetIdAsset id eg. DCT id is 1.3.0, as
AssetObjectIdorStringformat.Return Value
AssetAmountfee. -
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
typeOperation type.
assetIdAsset id eg. DCT id is 1.3.0, as
AssetObjectIdorStringformat.Return Value
AssetAmountfee.
View on GitHub
Install in Dash
ValidationApi Protocol Reference