EosioSoftkeySignatureProvider

public final class EosioSoftkeySignatureProvider : EosioSignatureProviderProtocol

Example signature provider for EOSIO SDK for Swift for signing transactions using in-memory K1 private keys. This signature provider implementation stores keys in memory and is therefore not secure. Use only for development purposes.

  • Initializes the signature provider using the private keys in the given array.

    Throws

    Throws an error if any of the keys in the given privateKeys array is not valid.

    Declaration

    Swift

    public init(privateKeys: [String]) throws

    Parameters

    privateKeys

    Array of private keys in String format.

  • Asynchronous method signing a transaction request. Invoked by an EosioTransaction during the signing process.

    Declaration

    Swift

    public func signTransaction(request: EosioTransactionSignatureRequest,
                                prompt: String,
                                completion: @escaping (EosioTransactionSignatureResponse) -> Void)

    Parameters

    request

    An EosioTransactionSignatureRequest struct (as defined in the EosioSwift library).

    prompt

    Prompt for biometric challenge if required. Ignored as softkey provider does no biometric auth.

    completion

    Calls the completion with an EosioTransactionSignatureResponse struct (as defined in the EosioSwift library).

  • Asynchronous method signing a transaction request. Invoked by an EosioTransaction during the signing process.

    Declaration

    Swift

    public func signTransaction(request: EosioTransactionSignatureRequest, completion: @escaping (EosioTransactionSignatureResponse) -> Void)

    Parameters

    request

    An EosioTransactionSignatureRequest struct (as defined in the EosioSwift library).

    completion

    Calls the completion with an EosioTransactionSignatureResponse struct (as defined in the EosioSwift library).

  • Asynchronous method that provides available public keys to the EosioTransaction during the signing preparation process.

    Declaration

    Swift

    public func getAvailableKeys(completion: @escaping (EosioAvailableKeysResponse) -> Void)

    Parameters

    completion

    Calls the completion with an EosioAvailableKeysResponse stuct containing an optional array of available public keys in String format.