Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to match API v2 #23

Merged
merged 6 commits into from
Oct 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

# Zaidan dealer client


_This repository is a mirror for the public client package from the Zaidan monorepo._

# Zaidan dealer client
Expand Down Expand Up @@ -135,4 +134,4 @@ Generate the vuepress site (output to `docs/.vuepress/dist`):

```
yarn docs:build
```
```
127 changes: 80 additions & 47 deletions docs/classes/dealerclient.md

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions docs/globals.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

# Zaidan dealer client


## Index

### Classes
Expand All @@ -12,6 +11,7 @@
### Interfaces

* [DealerFillTransaction](interfaces/dealerfilltransaction.md)
* [DealerOptions](interfaces/dealeroptions.md)
* [DealerResponse](interfaces/dealerresponse.md)
* [QuoteResponse](interfaces/quoteresponse.md)
* [SwapResponse](interfaces/swapresponse.md)
Expand All @@ -32,7 +32,7 @@

Ƭ **GasPriority**: *"safeLow" | "standard" | "fast" | "fastest"*

*Defined in [types.ts:74](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/df02572/src/types.ts#L74)*
*Defined in [types.ts:91](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/5dcfd78/src/types.ts#L91)*

Gas price priority (as used in ETH Gas Station API).

Expand All @@ -42,7 +42,7 @@ Gas price priority (as used in ETH Gas Station API).

▸ **convertZeroExTransactionToDealerFill**(`fillTx`: SignedZeroExTransaction, `quoteId`: string): *[DealerFillTransaction](interfaces/dealerfilltransaction.md)*

*Defined in [utils.ts:55](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/df02572/src/utils.ts#L55)*
*Defined in [utils.ts:55](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/5dcfd78/src/utils.ts#L55)*

Create a dealer POST /order request body from a signed 0x fill transaction and
the quote ID corresponding to the signed transaction data.
Expand All @@ -64,7 +64,7 @@ ___

▸ **createAndSignZeroExTransaction**(`provider`: SupportedProvider, `signerAddress`: string, `verifyingContractAddress`: string, `order`: SignedOrder, `takerAmount`: BigNumber): *Promise‹SignedZeroExTransaction›*

*Defined in [utils.ts:27](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/df02572/src/utils.ts#L27)*
*Defined in [utils.ts:27](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/5dcfd78/src/utils.ts#L27)*

Given a signed 0x order, signer address, and taker asset amount, prepare and
sign a 0x fill transaction to be submitted to the verifying exchange contract
Expand Down Expand Up @@ -93,7 +93,7 @@ ___

▸ **getGasPrice**(`priority`: [GasPriority](globals.md#gaspriority)): *Promise‹BigNumber›*

*Defined in [utils.ts:67](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/df02572/src/utils.ts#L67)*
*Defined in [utils.ts:67](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/5dcfd78/src/utils.ts#L67)*

Fetch a gas price from Etherchain.org for a given priority (tx conf speed).

Expand All @@ -103,4 +103,4 @@ Name | Type | Description |
------ | ------ | ------ |
`priority` | [GasPriority](globals.md#gaspriority) | Get gas price for provided priority (see [GasPricePriority]). |

**Returns:** *Promise‹BigNumber›*
**Returns:** *Promise‹BigNumber›*
15 changes: 7 additions & 8 deletions docs/interfaces/dealerfilltransaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

# Interface: DealerFillTransaction


Request body for dealer POST /order (submit fill) endpoint.

## Hierarchy
Expand All @@ -26,7 +25,7 @@ Request body for dealer POST /order (submit fill) endpoint.

• **address**: *string*

*Defined in [types.ts:65](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/df02572/src/types.ts#L65)*
*Defined in [types.ts:82](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/5dcfd78/src/types.ts#L82)*

The taker address (and signer).

Expand All @@ -36,7 +35,7 @@ ___

• **data**: *string*

*Defined in [types.ts:56](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/df02572/src/types.ts#L56)*
*Defined in [types.ts:73](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/5dcfd78/src/types.ts#L73)*

Raw hex-encoded fill transaction data.

Expand All @@ -46,7 +45,7 @@ ___

• **hash**: *string*

*Defined in [types.ts:59](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/df02572/src/types.ts#L59)*
*Defined in [types.ts:76](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/5dcfd78/src/types.ts#L76)*

0x transaction hash (hash of data, etc.).

Expand All @@ -56,7 +55,7 @@ ___

• **quoteId**: *string*

*Defined in [types.ts:68](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/df02572/src/types.ts#L68)*
*Defined in [types.ts:85](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/5dcfd78/src/types.ts#L85)*

Required UUID from initial quote (must match signed order).

Expand All @@ -66,7 +65,7 @@ ___

• **salt**: *string*

*Defined in [types.ts:53](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/df02572/src/types.ts#L53)*
*Defined in [types.ts:70](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/5dcfd78/src/types.ts#L70)*

Salt used in signature generation.

Expand All @@ -76,6 +75,6 @@ ___

• **sig**: *string*

*Defined in [types.ts:62](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/df02572/src/types.ts#L62)*
*Defined in [types.ts:79](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/5dcfd78/src/types.ts#L79)*

Signature generated by signer (`address`) from signing fill transaction.
Signature generated by signer (`address`) from signing fill transaction.
47 changes: 47 additions & 0 deletions docs/interfaces/dealeroptions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[Zaidan dealer client](../README.md) › [Globals](../globals.md) › [DealerOptions](dealeroptions.md)

# Interface: DealerOptions

Configuration options for the dealer client.

## Hierarchy

* **DealerOptions**

## Index

### Properties

* [providerUrl](dealeroptions.md#optional-providerurl)
* [takerAddress](dealeroptions.md#optional-takeraddress)
* [txPriority](dealeroptions.md#optional-txpriority)

## Properties

### `Optional` providerUrl

• **providerUrl**? : *string*

*Defined in [types.ts:11](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/5dcfd78/src/types.ts#L11)*

Ethereum JSONRPC provider url (server-side only)

___

### `Optional` takerAddress

• **takerAddress**? : *string*

*Defined in [types.ts:8](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/5dcfd78/src/types.ts#L8)*

Address to use to sign and fill orders.

___

### `Optional` txPriority

• **txPriority**? : *[GasPriority](../globals.md#gaspriority)*

*Defined in [types.ts:14](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/5dcfd78/src/types.ts#L14)*

Optional gas price selector (fast, safeLow, etc.)
28 changes: 19 additions & 9 deletions docs/interfaces/dealerresponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

# Interface: DealerResponse


The base dealer response, fields present for all quotes (swap/bid/ask).

## Hierarchy
Expand All @@ -24,14 +23,15 @@ The base dealer response, fields present for all quotes (swap/bid/ask).
* [pair](dealerresponse.md#pair)
* [price](dealerresponse.md#price)
* [size](dealerresponse.md#size)
* [takerAddress](dealerresponse.md#takeraddress)

## Properties

### expiration

• **expiration**: *number*

*Defined in [types.ts:8](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/df02572/src/types.ts#L8)*
*Defined in [types.ts:25](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/5dcfd78/src/types.ts#L25)*

The UNIX timestamp at which this offer expires.

Expand All @@ -41,7 +41,7 @@ ___

• **fee**: *number*

*Defined in [types.ts:23](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/df02572/src/types.ts#L23)*
*Defined in [types.ts:40](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/5dcfd78/src/types.ts#L40)*

The required fee from the dealer server.

Expand All @@ -51,7 +51,7 @@ ___

• **id**: *string*

*Defined in [types.ts:14](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/df02572/src/types.ts#L14)*
*Defined in [types.ts:31](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/5dcfd78/src/types.ts#L31)*

The unique request ID that refers to this offer.

Expand All @@ -61,7 +61,7 @@ ___

• **order**: *SignedOrder*

*Defined in [types.ts:26](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/df02572/src/types.ts#L26)*
*Defined in [types.ts:43](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/5dcfd78/src/types.ts#L43)*

The signed maker order from the dealer server.

Expand All @@ -71,7 +71,7 @@ ___

• **pair**: *string*

*Defined in [types.ts:11](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/df02572/src/types.ts#L11)*
*Defined in [types.ts:28](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/5dcfd78/src/types.ts#L28)*

The market symbol the quote is for

Expand All @@ -81,7 +81,7 @@ ___

• **price**: *number*

*Defined in [types.ts:17](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/df02572/src/types.ts#L17)*
*Defined in [types.ts:34](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/5dcfd78/src/types.ts#L34)*

The price and order data for the quote.

Expand All @@ -91,6 +91,16 @@ ___

• **size**: *number*

*Defined in [types.ts:20](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/df02572/src/types.ts#L20)*
*Defined in [types.ts:37](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/5dcfd78/src/types.ts#L37)*

The taker size, specified in the initial request.

___

### takerAddress

• **takerAddress**: *string*

*Defined in [types.ts:22](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/5dcfd78/src/types.ts#L22)*

The taker size, specified in the initial request.
The taker address which must fill the order (no other taker will be accepted).
32 changes: 22 additions & 10 deletions docs/interfaces/quoteresponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

# Interface: QuoteResponse


The dealer's response for a currency pair quote (bid/ask on X/Y pair).

## Hierarchy
Expand All @@ -23,6 +22,7 @@ The dealer's response for a currency pair quote (bid/ask on X/Y pair).
* [price](quoteresponse.md#price)
* [side](quoteresponse.md#side)
* [size](quoteresponse.md#size)
* [takerAddress](quoteresponse.md#takeraddress)

## Properties

Expand All @@ -32,7 +32,7 @@ The dealer's response for a currency pair quote (bid/ask on X/Y pair).

*Inherited from [DealerResponse](dealerresponse.md).[expiration](dealerresponse.md#expiration)*

*Defined in [types.ts:8](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/df02572/src/types.ts#L8)*
*Defined in [types.ts:25](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/5dcfd78/src/types.ts#L25)*

The UNIX timestamp at which this offer expires.

Expand All @@ -44,7 +44,7 @@ ___

*Inherited from [DealerResponse](dealerresponse.md).[fee](dealerresponse.md#fee)*

*Defined in [types.ts:23](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/df02572/src/types.ts#L23)*
*Defined in [types.ts:40](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/5dcfd78/src/types.ts#L40)*

The required fee from the dealer server.

Expand All @@ -56,7 +56,7 @@ ___

*Inherited from [DealerResponse](dealerresponse.md).[id](dealerresponse.md#id)*

*Defined in [types.ts:14](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/df02572/src/types.ts#L14)*
*Defined in [types.ts:31](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/5dcfd78/src/types.ts#L31)*

The unique request ID that refers to this offer.

Expand All @@ -68,7 +68,7 @@ ___

*Inherited from [DealerResponse](dealerresponse.md).[order](dealerresponse.md#order)*

*Defined in [types.ts:26](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/df02572/src/types.ts#L26)*
*Defined in [types.ts:43](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/5dcfd78/src/types.ts#L43)*

The signed maker order from the dealer server.

Expand All @@ -80,7 +80,7 @@ ___

*Inherited from [DealerResponse](dealerresponse.md).[pair](dealerresponse.md#pair)*

*Defined in [types.ts:11](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/df02572/src/types.ts#L11)*
*Defined in [types.ts:28](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/5dcfd78/src/types.ts#L28)*

The market symbol the quote is for

Expand All @@ -92,7 +92,7 @@ ___

*Inherited from [DealerResponse](dealerresponse.md).[price](dealerresponse.md#price)*

*Defined in [types.ts:17](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/df02572/src/types.ts#L17)*
*Defined in [types.ts:34](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/5dcfd78/src/types.ts#L34)*

The price and order data for the quote.

Expand All @@ -102,7 +102,7 @@ ___

• **side**: *string*

*Defined in [types.ts:45](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/df02572/src/types.ts#L45)*
*Defined in [types.ts:62](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/5dcfd78/src/types.ts#L62)*

The side of the quote (bid or ask).

Expand All @@ -114,6 +114,18 @@ ___

*Inherited from [DealerResponse](dealerresponse.md).[size](dealerresponse.md#size)*

*Defined in [types.ts:20](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/df02572/src/types.ts#L20)*
*Defined in [types.ts:37](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/5dcfd78/src/types.ts#L37)*

The taker size, specified in the initial request.

___

### takerAddress

• **takerAddress**: *string*

*Inherited from [DealerResponse](dealerresponse.md).[takerAddress](dealerresponse.md#takeraddress)*

*Defined in [types.ts:22](https://github.com/ParadigmFoundation/zaidan-dealer-client/blob/5dcfd78/src/types.ts#L22)*

The taker size, specified in the initial request.
The taker address which must fill the order (no other taker will be accepted).
Loading