From e4b27646a0b6de1f0630c1bd343162a945163465 Mon Sep 17 00:00:00 2001 From: Rodrigo <95635797+poly-rodr@users.noreply.github.com> Date: Fri, 9 Sep 2022 10:12:05 -0300 Subject: [PATCH] updating contracts --- package.json | 2 +- src/model/order.model.ts | 52 ++++++++++++++++++++-------------------- src/networks.ts | 24 +++++++++---------- 3 files changed, 39 insertions(+), 39 deletions(-) diff --git a/package.json b/package.json index 865b8e4..8b4c392 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@polymarket/order-utils", - "version": "1.2.14", + "version": "1.2.15", "description": "Typescript utility for creating orders for Polymarket's CLOB", "author": "Liam Kovatch ", "homepage": "https://github.com/Polymarket/clob-order-utils", diff --git a/src/model/order.model.ts b/src/model/order.model.ts index df14566..c364e90 100644 --- a/src/model/order.model.ts +++ b/src/model/order.model.ts @@ -1,5 +1,5 @@ -import { SignatureType } from "../signature-types"; -import { EIP712Object } from "./eip712.model"; +import {SignatureType} from '../signature-types'; +import {EIP712Object} from './eip712.model'; export type LimitOrderSignature = string; @@ -15,7 +15,7 @@ export interface LimitOrderData { takerAssetID?: string; makerAmount: string; takerAmount: string; - signer?: string // Address performing the signing + signer?: string; // Address performing the signing sigType?: SignatureType; // Signature scheme being used expiry?: number; nonce?: number; @@ -66,7 +66,6 @@ export interface MarketOrder extends EIP712Object { export type OrderType = string; - // Standard LimitOrder object to be used as the entry point in the CLOB export interface LimitOrderAndSignature { order: LimitOrder; @@ -74,7 +73,7 @@ export interface LimitOrderAndSignature { orderType: OrderType; } -export type TimeInForce = "FOK" | "IOC" +export type TimeInForce = 'FOK' | 'IOC'; // Standard MarketOrder object to be used as entry points for Market orders in the CLOB export interface MarketOrderAndSignature { @@ -82,28 +81,29 @@ export interface MarketOrderAndSignature { signature: MarketOrderSignature; orderType: OrderType; minAmountReceived?: string; // Optional slippage protection field - timeInForce?: TimeInForce; // Optional market order type: FOK (fill or kill) / IOC (immediate or cancel) + // Optional market order type: FOK (fill or kill) / IOC (immediate or cancel) + timeInForce?: TimeInForce; } export enum LimitOrderProtocolMethods { - getMakerAmount = "getMakerAmount", - getTakerAmount = "getTakerAmount", - fillOrder = "fillOrder", - cancelOrder = "cancelOrder", - nonce = "nonce", - advanceNonce = "advanceNonce", - increaseNonce = "increaseNonce", - and = "and", - or = "or", - eq = "eq", - lt = "lt", - gt = "gt", - timestampBelow = "timestampBelow", - nonceEquals = "nonceEquals", - remaining = "remaining", - transferFrom = "transferFrom", - checkPredicate = "checkPredicate", - remainingsRaw = "remainingsRaw", - domainSeparator = "domainSeparator", - batchFillOrders = "batchFillOrders", + getMakerAmount = 'getMakerAmount', + getTakerAmount = 'getTakerAmount', + fillOrder = 'fillOrder', + cancelOrder = 'cancelOrder', + nonce = 'nonce', + advanceNonce = 'advanceNonce', + increaseNonce = 'increaseNonce', + and = 'and', + or = 'or', + eq = 'eq', + lt = 'lt', + gt = 'gt', + timestampBelow = 'timestampBelow', + nonceEquals = 'nonceEquals', + remaining = 'remaining', + transferFrom = 'transferFrom', + checkPredicate = 'checkPredicate', + remainingsRaw = 'remainingsRaw', + domainSeparator = 'domainSeparator', + batchFillOrders = 'batchFillOrders', } diff --git a/src/networks.ts b/src/networks.ts index c2f954f..38012b9 100644 --- a/src/networks.ts +++ b/src/networks.ts @@ -5,19 +5,19 @@ export interface ClobContracts { Conditional: string; } -export const MUMBAI_CONTRACTS : ClobContracts = { - Exchange: "0x6D486b31b5c0f724828Aff07c88606b213B0D196", - Executor: "0x6b0ab7A1E65ea6AE9072f6c45B4261ACDfB30827", - Collateral: "0x2E8DCfE708D44ae2e406a1c02DFE2Fa13012f961", - Conditional: "0x7D8610E9567d2a6C9FBf66a5A13E9Ba8bb120d43" -} +export const MUMBAI_CONTRACTS: ClobContracts = { + Exchange: '0xA5caFCC00E8D8E9121CC18B2DF279Eab5dE43bC5', + Executor: '0xb2a29463Df393a4CAef36541544715e6B48b80B7', + Collateral: '0x2E8DCfE708D44ae2e406a1c02DFE2Fa13012f961', + Conditional: '0x7D8610E9567d2a6C9FBf66a5A13E9Ba8bb120d43', +}; export const MATIC_CONTRACTS: ClobContracts = { - Exchange: "0x6D486b31b5c0f724828Aff07c88606b213B0D196", - Executor: "0x6b0ab7A1E65ea6AE9072f6c45B4261ACDfB30827", - Collateral: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", - Conditional: "0x4D97DCd97eC945f40cF65F87097ACe5EA0476045", -} + Exchange: '0xA5caFCC00E8D8E9121CC18B2DF279Eab5dE43bC5', + Executor: '0xb2a29463Df393a4CAef36541544715e6B48b80B7', + Collateral: '0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174', + Conditional: '0x4D97DCd97eC945f40cF65F87097ACe5EA0476045', +}; export const getContracts = (chainID: number): ClobContracts => { switch (chainID) { @@ -27,6 +27,6 @@ export const getContracts = (chainID: number): ClobContracts => { return MUMBAI_CONTRACTS; default: console.error(`Invalid chainID: ${chainID}`); - throw new Error("Invalid network"); + throw new Error('Invalid network'); } };