Skip to content

Commit

Permalink
Merge pull request #10 from Polymarket/chore/update-clob-contracts
Browse files Browse the repository at this point in the history
updating contracts
  • Loading branch information
poly-rodr authored Sep 9, 2022
2 parents 3db99d2 + e4b2764 commit 79bed5b
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>",
"homepage": "https://github.com/Polymarket/clob-order-utils",
Expand Down
52 changes: 26 additions & 26 deletions src/model/order.model.ts
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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;
Expand Down Expand Up @@ -66,44 +66,44 @@ 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;
signature: LimitOrderSignature;
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 {
order: MarketOrder;
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',
}
24 changes: 12 additions & 12 deletions src/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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');
}
};

0 comments on commit 79bed5b

Please sign in to comment.