Hi team recently I was using the package @0x/contract-wrappers to interact with 0x but now stuck at the function call, my code:

const Web3 = require('web3');
const ContractWrappers = require('@0x/contract-wrappers').ContractWrappers;
const provider = new Web3.providers.HttpProvider('https://eth- 

(async () => {
    const contractWrappers = new ContractWrappers(provider, {chainId: 1});
    const exchange = contractWrappers.exchangeProxy;
    const order = exchange.getRfqOrderInfo({
            "maker": "0xca77dc47eec9e1c46c9f541ba0f222e741d6236b",
            "taker": "0x0000000000000000000000000000000000000000",
            "makerToken": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
            "takerToken": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
            "makerAmount": 25000000,
            "takerAmount": 46990500000000000,
            "txOrigin": "0xbd49a97300e10325c78d6b4ec864af31623bb5dd",
            "pool": "0x0000000000000000000000000000000000000000000000000000000000000017",
            "salt": 1611000201000,
            "expiry": 1611001201,
    await order.sendTransactionAsync()

when I call the function "getRfqOrderInfo" and get the return object "ContractTxFunctionObj", could anyone please tell me how to use this object to fetch the order info?

Thanks so much!

1 Answer 1


When it's a write action you can call the following on the ContractTxFunctionObj

// send transaction
let callResult = await order.callAsync();

// wait for it to get mined
let receipt = await order.awaitTransactionSuccessAsync();

But here since it's just a read action, the following should be enough

let callResult = await order.callAsync();

  • ok thanks let me try! And if don't mind could you tell me how to do the order sign? I'd tried to follow the doc(protocol.0x.org/en/latest/basics/orders.html#how-to-sign), but I don't know how to convert my secret key to the format it need. I'd try web3.utils.toHex() but it still return me with "Error: Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: 0xNaN" when I call await order.getSignatureWithKey(secret_key);
    – Rumble
    Commented Sep 2, 2021 at 11:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.