How to use the @0x/contract-wrappers.ContractError.SignatureRequestDenied function in @0x/contract-wrappers

To help you get started, we’ve selected a few @0x/contract-wrappers 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-monorepo / packages / asset-swapper / src / quote_consumers / exchange_swap_quote_consumer.ts View on Github external
} else {
                const { takerAssetFillAmount } = quote;
                txHash = await this._contractWrappers.exchange.marketSellOrdersNoThrow.sendTransactionAsync(
                    orders,
                    takerAssetFillAmount,
                    orders.map(o => o.signature),
                    {
                        from: finalTakerAddress,
                        gas: gasLimit,
                        gasPrice,
                    },
                );
            }
            return txHash;
        } catch (err) {
            if (_.includes(err.message, ContractError.SignatureRequestDenied)) {
                throw new Error(SwapQuoteConsumerError.SignatureRequestDenied);
            } else if (_.includes(err.message, ForwarderError.CompleteFillFailed)) {
                throw new Error(SwapQuoteConsumerError.TransactionValueTooLow);
            } else {
                throw err;
            }
        }
    }
}