How to use the @0x/contracts-test-utils.orderHashUtils.getOrderHashHex function in @0x/contracts-test-utils

To help you get started, we’ve selected a few @0x/contracts-test-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github 0xProject / 0x-coordinator-server / ts / src / handlers.ts View on Github external
            o => !_.includes(softCancelledOrderHashes, orderHashUtils.getOrderHashHex(o)),
        );
github 0xProject / 0x-coordinator-server / ts / src / models / order_model.ts View on Github external
getHash(order: Order): string {
        const orderHash = orderHashUtils.getOrderHashHex(order);
        return orderHash;
    },
};
github 0xProject / 0x-monorepo / contracts / exchange / src / exchange_data_encoder.ts View on Github external
orders.map(order => order[fillAsset]).reduce((prev, curr) => prev.plus(curr)),
                    orders.map(order => order.signature),
                )
                .getABIEncodedTransactionData();
        } else if (constants.MATCH_ORDER_FN_NAMES.indexOf(fnName) !== -1) {
            data = exchangeInstance
                .matchOrders(orders[0], orders[1], orders[0].signature, orders[1].signature)
                .getABIEncodedTransactionData();
        } else if (fnName === ExchangeFunctionName.CancelOrder) {
            data = exchangeInstance.cancelOrder(orders[0]).getABIEncodedTransactionData();
        } else if (fnName === ExchangeFunctionName.BatchCancelOrders) {
            data = exchangeInstance.batchCancelOrders(orders).getABIEncodedTransactionData();
        } else if (fnName === ExchangeFunctionName.CancelOrdersUpTo) {
            data = exchangeInstance.cancelOrdersUpTo(constants.ZERO_AMOUNT).getABIEncodedTransactionData();
        } else if (fnName === ExchangeFunctionName.PreSign) {
            data = exchangeInstance.preSign(orderHashUtils.getOrderHashHex(orders[0])).getABIEncodedTransactionData();
        } else if (fnName === ExchangeFunctionName.SetSignatureValidatorApproval) {
            data = exchangeInstance
                .setSignatureValidatorApproval(constants.NULL_ADDRESS, true)
                .getABIEncodedTransactionData();
        } else {
            throw new Error(`Error: ${fnName} not a supported function`);
        }
        return data;
    },
};