UNPKG

@f5i23q999d/cow-sdk

Version:

<p align="center"> <img width="400" src="https://github.com/cowprotocol/cow-sdk/raw/main/docs/images/CoW.png" /> </p>

26 lines 966 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getOrderTypedData = void 0; const contracts_1 = require("@cowprotocol/contracts"); const types_1 = require("./types.js"); const order_signing_1 = require("../order-signing/index.js"); const EIP712DomainTypes = [ { name: 'name', type: 'string' }, { name: 'version', type: 'string' }, { name: 'chainId', type: 'uint256' }, { name: 'verifyingContract', type: 'address' }, ]; async function getOrderTypedData(chainId, orderToSign) { const domain = (await order_signing_1.OrderSigningUtils.getDomain(chainId)); return { domain, primaryType: types_1.ORDER_PRIMARY_TYPE, types: { [types_1.ORDER_PRIMARY_TYPE]: contracts_1.ORDER_TYPE_FIELDS, EIP712Domain: EIP712DomainTypes, }, message: orderToSign, }; } exports.getOrderTypedData = getOrderTypedData; //# sourceMappingURL=getOrderTypedData.js.map