Skip to content
This repository was archived by the owner on Oct 11, 2024. It is now read-only.
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
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ This changelog is a work in progress and may contain notes for versions which ha
- Developers can now override the contract addresses for any testnet using the `CUSTOM_CONTRACT_ADDRESSES` env config ([#640](https://github.com/0xProject/0x-mesh/pull/640)).
- Added `getOrdersForPageAsync` method to `@0x/mesh-rpc-client` WS client interface so that clients can paginate through the retrieved orders themselves ([#642](https://github.com/0xProject/0x-mesh/pull/642)).
- Added support for passing in your own Web3 provider when using the `@0x/mesh-browser` package. ([#665](https://github.com/0xProject/0x-mesh/pull/665)).
- Add support for orders involving Chai ERC20Bridge assetData ([#663](https://github.com/0xProject/0x-mesh/pull/663))
- Add support for orders involving Chai ERC20Bridge assetData ([#663](https://github.com/0xProject/0x-mesh/pull/663))
- Add support for calling JSON-RPC methods over HTTP (env config `HTTP_RPC_ADDR` defaults to `localhost:60556`). ([#658](https://github.com/0xProject/0x-mesh/pull/658))

### Bug fixes 🐞

- Fixed some of the browser typescript bindings to be consistent with the Go and smart contract implementations ([#697](https://github.com/0xProject/0x-mesh/pull/697)).

## v8.2.0

Expand Down
24 changes: 17 additions & 7 deletions browser/ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,13 @@ export interface OrderInfo {

interface WrapperGetOrdersResponse {
snapshotID: string;
snapshotTimestamp: number;
snapshotTimestamp: string;
ordersInfos: WrapperOrderInfo[];
}

export interface GetOrdersResponse {
snapshotID: string;
snapshotTimestamp: number;
snapshotTimestamp: Date;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is technically a breaking change. I'm okay with merging for now but let's update the changelog later before we release 9.0.0.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0xee3512fbf0f301e14015c8f91ac02beeba256bfd0857457b7a05c2e41d089522

ordersInfos: OrderInfo[];
}

Expand Down Expand Up @@ -450,9 +450,12 @@ export interface ExchangeFillEvent {
takerAssetFilledAmount: BigNumber;
makerFeePaid: BigNumber;
takerFeePaid: BigNumber;
protocolFeePaid: BigNumber;
orderHash: string;
makerAssetData: string;
takerAssetData: string;
makerFeeAssetData: string;
takerFeeAssetData: string;
}

interface WrapperExchangeFillEvent {
Expand All @@ -464,9 +467,12 @@ interface WrapperExchangeFillEvent {
takerAssetFilledAmount: string;
makerFeePaid: string;
takerFeePaid: string;
protocolFeePaid: BigNumber;
orderHash: string;
makerAssetData: string;
takerAssetData: string;
makerFeeAssetData: string;
takerFeeAssetData: string;
}

export interface ExchangeCancelEvent {
Expand All @@ -480,13 +486,13 @@ export interface ExchangeCancelEvent {

export interface ExchangeCancelUpToEvent {
makerAddress: string;
senderAddress: string;
orderSenderAddress: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change also.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi

orderEpoch: BigNumber;
}

interface WrapperExchangeCancelUpToEvent {
makerAddress: string;
senderAddress: string;
orderSenderAddress: string;
orderEpoch: string;
}

Expand Down Expand Up @@ -561,7 +567,7 @@ export interface ContractEvent {
txHash: string;
txIndex: number;
logIndex: number;
isRemoved: string;
isRemoved: boolean;
address: string;
kind: ContractEventKind;
parameters: ContractEventParameters;
Expand All @@ -573,7 +579,7 @@ interface WrapperContractEvent {
txHash: string;
txIndex: number;
logIndex: number;
isRemoved: string;
isRemoved: boolean;
address: string;
kind: string;
parameters: WrapperContractEventParameters;
Expand Down Expand Up @@ -1010,9 +1016,12 @@ function wrapperContractEventsToContractEvents(wrapperContractEvents: WrapperCon
takerAssetFilledAmount: new BigNumber(exchangeFillEvent.takerAssetFilledAmount),
makerFeePaid: new BigNumber(exchangeFillEvent.makerFeePaid),
takerFeePaid: new BigNumber(exchangeFillEvent.takerFeePaid),
protocolFeePaid: new BigNumber(exchangeFillEvent.protocolFeePaid),
orderHash: exchangeFillEvent.orderHash,
makerAssetData: exchangeFillEvent.makerAssetData,
takerAssetData: exchangeFillEvent.takerAssetData,
makerFeeAssetData: exchangeFillEvent.makerFeeAssetData,
takerFeeAssetData: exchangeFillEvent.takerFeeAssetData,
};
break;
case ContractEventKind.ExchangeCancelEvent:
Expand All @@ -1022,7 +1031,7 @@ function wrapperContractEventsToContractEvents(wrapperContractEvents: WrapperCon
const exchangeCancelUpToEvent = rawParameters as WrapperExchangeCancelUpToEvent;
parameters = {
makerAddress: exchangeCancelUpToEvent.makerAddress,
senderAddress: exchangeCancelUpToEvent.senderAddress,
orderSenderAddress: exchangeCancelUpToEvent.orderSenderAddress,
orderEpoch: new BigNumber(exchangeCancelUpToEvent.orderEpoch),
};
break;
Expand Down Expand Up @@ -1102,6 +1111,7 @@ function wrapperGetOrdersResponseToGetOrdersResponse(
): GetOrdersResponse {
return {
...wrapperGetOrdersResponse,
snapshotTimestamp: new Date(wrapperGetOrdersResponse.snapshotTimestamp),
ordersInfos: wrapperGetOrdersResponse.ordersInfos.map(wrapperOrderInfoToOrderInfo),
};
}
Expand Down
3 changes: 2 additions & 1 deletion zeroex/order_js.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"strings"
"syscall/js"
"time"

"github.com/ethereum/go-ethereum/common"
)
Expand All @@ -16,7 +17,7 @@ func (o OrderEvent) JSValue() js.Value {
contractEventsJS[i] = contractEvent.JSValue()
}
return js.ValueOf(map[string]interface{}{
"timestamp": o.Timestamp.String(),
"timestamp": o.Timestamp.Format(time.RFC3339),
"orderHash": o.OrderHash.Hex(),
"signedOrder": o.SignedOrder.JSValue(),
"endState": string(o.EndState),
Expand Down