Skip to content

DEXter Exchange Integration

Pre-release
Pre-release
Compare
Choose a tag to compare
@keefertaylor keefertaylor released this 26 Sep 07:04
33c1a38

New Features

DEXter Integration

In collaboration with CamlCase, TezosKit provides first class integration for DEXter, a decentralized exchange built on Tezos.

Clients can interact with a DEXter smart contract through the new DexterExchangeClient class. Clients can also interact with underlying token contracts using the new TokenContractClient class.

Fee, Gas Limit and Storage Limit Policy

A new enum, OperationFeesPolicy provides a more granular way to provide fees for operations on the Tezos blockchain. OperationsFeesPolicy has three cases:
(1) default: use the default fees for the protocol
(2) custom: provide your own OperationFees via an associated value
(3) estimate: estimate and apply fees for your operation via simulating the operation on the Tezos blockchain.

New APIs have been exposed to allow users to pass these enums. The default is default.

// New API
public func delegate(
    from source: Address,
    to delegate: Address,
    signatureProvider: SignatureProvider,
    operationFeePolicy: OperationFeePolicy = .default,
    completion: @escaping (Result<String, TezosKitError>) -> Void
) { ... }

// Usage Examples

// Use default fees
delegate(<...>, .default) 

// Use custom fees
let operationFees = OperationFees(<...>)
delegate(<...>, .custom(operationFees));

// Estimate fees
delegate(<...>, .estimate);

Older versions of TezosKit allowed users to pass an optional OperationFees object when appending an operation to the ledger. These APIs are now deprecated:

// Deprecated
public func delegate(
    from source: Address,
    to delegate: Address,
    signatureProvider: SignatureProvider,
    operationFees: OperationFees? = nil,
    completion: @escaping (Result<String, TezosKitError>) -> Void
) { ... }