This repository has been archived by the owner on Aug 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
/
EosioRpcProviderProtocol.swift
57 lines (45 loc) · 2.7 KB
/
EosioRpcProviderProtocol.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//
// RpcProviderProtocol.swift
// EosioSwift
//
// Created by Steve McCoole on 2/19/19.
// Copyright (c) 2017-2019 block.one and its contributors. All rights reserved.
//
import Foundation
// Protocol defining the endpoints required by the core EOSIO SDK for Swift library.
// This protocol is intended to define/enforce the minimum functionality and response
// information that is required by the internals of the EOSIO SDK for Swift library,
// not for a generic interface to multiple RPC provider impelementations by outside
// code. Therefore, they append 'Base' to the function names to separate them from the full
// response signature implementations that are provided by concrete RPC provider
// implementations.
// Previous versions of Swift did not flag the over lap between the signatures that
// return the protocol conforming response from the concrete response but starting
// with Swift 5.3 these types of conditions are now flagged by the compiler as
// ambiguious references, so the protocol has change to address this.
public protocol EosioRpcProviderProtocol {
/// Calls /v1/chain/get_info.
///
/// - Parameter completion: Completion called with an `EosioResult`.
func getInfoBase(completion: @escaping(EosioResult<EosioRpcInfoResponseProtocol, EosioError>) -> Void)
/// Calls /v1/chain/get_block_info.
///
/// - Parameter completion: Completion called with an `EosioResult`.
func getBlockInfoBase(requestParameters: EosioRpcBlockInfoRequest, completion: @escaping(EosioResult<EosioRpcBlockInfoResponseProtocol, EosioError>) -> Void)
/// Calls /v1/chain/get_raw_abi.
///
/// - Parameter completion: Completion called with an `EosioResult`.
func getRawAbiBase(requestParameters: EosioRpcRawAbiRequest, completion: @escaping(EosioResult<EosioRpcRawAbiResponseProtocol, EosioError>) -> Void)
/// Calls /v1/chain/get_required_keys.
///
/// - Parameter completion: Completion called with an `EosioResult`.
func getRequiredKeysBase(requestParameters: EosioRpcRequiredKeysRequest, completion: @escaping(EosioResult<EosioRpcRequiredKeysResponseProtocol, EosioError>) -> Void)
/// Calls /v1/chain/push_transaction.
///
/// - Parameter completion: Completion called with an `EosioResult`.
func pushTransactionBase(requestParameters: EosioRpcPushTransactionRequest, completion: @escaping(EosioResult<EosioRpcTransactionResponseProtocol, EosioError>) -> Void)
/// Calls /v1/chain/push_transaction.
///
/// - Parameter completion: Completion called with an `EosioResult`.
func sendTransactionBase(requestParameters: EosioRpcSendTransactionRequest, completion: @escaping(EosioResult<EosioRpcTransactionResponseProtocol, EosioError>) -> Void)
}