@georgeroman/wyvern-v2-sdk
Version:
Wyvern V2 SDK
19 lines • 893 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getSalt = exports.getListingTime = exports.bn = exports.Bytes32Zero = void 0;
const bignumber_1 = require("@ethersproject/bignumber");
const random_1 = require("@ethersproject/random");
// BigNumber utils
exports.Bytes32Zero = "0x0000000000000000000000000000000000000000000000000000000000000000";
const bn = (value) => bignumber_1.BigNumber.from(value);
exports.bn = bn;
// WyvernV2 utils
const getListingTime = () =>
// Set the listing time 2 minutes in the past to make sure
// on-chain order validation passes (listing time is checked
// to be less than the blockchain time).
(0, exports.bn)(Math.floor(Date.now() / 1000) - 2 * 60);
exports.getListingTime = getListingTime;
const getSalt = () => (0, exports.bn)((0, random_1.randomBytes)(32));
exports.getSalt = getSalt;
//# sourceMappingURL=utils.js.map