TaquitoService
public class TaquitoService
Taquito (https://github.com/ecadlabs/taquito) is a popular open source Tezos library written in Typescript and Javascript. Taquito is made up of many separate packages that deal with various aspects of Tezos RPC and Michelson. This serivce class is a wrapper around a small piece of the Taquito library to expose funtionality that would otherwise be time consuming/risky/dangerous to re-implement natively. The JS can now be found on each github release here: https://github.com/ecadlabs/taquito/releases/, by extracting the zip named “taquito-local-forging-vanilla.zip”
-
Unique TaquitoService errors
See moreDeclaration
Swift
public enum TaquitoServiceError : Error
-
Public shared instace to avoid having multiple copies of the underlying
JSContext
createdDeclaration
Swift
public static let shared: TaquitoService
-
Wrapper around the node package @taquito/local-forging’s forge method. Giving the ability to locally forge an
OperationPayload
without using an RPC, and avoiding the need to do an RPC parse against a second server. Note: Currently only one forge can take place at a time. Multiple simultaneous calls will result in an error being returned. See package: https://github.com/ecadlabs/taquito/tree/master/packages/taquito-local-forging, and docs: https://tezostaquito.io/typedoc/modules/_taquito_local_forging.htmlDeclaration
Swift
public func forge(operationPayload: OperationPayload, completion: @escaping ((Result<String, KukaiError>) -> Void))
Parameters
operationPayload
The payload to forge. Can be constructed using
OperationFactory.operationPayload(...)
.completion
The underlying javascript code uses a Promise. In order to wrap this up into native Swift, we need to provide a completion callback to return the resulting hex string.
-
Wrapper around the node package @taquito/local-forging’s prase method. Giving the ability to locally parse a hex string back into an
OperationPayload
, without the need to use an RPC on a tezos node. Note: Currently only one parse can take place at a time. Multiple simultaneous calls will result in an error being returned. See package: https://github.com/ecadlabs/taquito/tree/master/packages/taquito-local-forging, and docs: https://tezostaquito.io/typedoc/modules/_taquito_local_forging.htmlDeclaration
Swift
public func parse(hex: String, completion: @escaping ((Result<OperationPayload, KukaiError>) -> Void))
Parameters
hex
The string that needs to be parsed into an
OperationPayload
.completion
The underlying javascript code uses a Promise. In order to wrap this up into native Swift, we need to provide a completion callback to return the resulting object