Skip to content

Commit

Permalink
amoy
Browse files Browse the repository at this point in the history
  • Loading branch information
poly-rodr committed Apr 11, 2024
1 parent d3c4458 commit 829af1d
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 51 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@polymarket/clob-client",
"description": "Typescript client for Polymarket's CLOB",
"version": "4.4.2",
"version": "4.5.0",
"contributors": [
{
"name": "Jonathan Amenechi",
Expand Down Expand Up @@ -41,7 +41,7 @@
"test": "make test"
},
"dependencies": {
"@polymarket/order-utils": "^2.0.0",
"@polymarket/order-utils": "^2.1.0",
"axios": "^0.27.2",
"browser-or-node": "^2.1.1",
"ethers": "^5.7.1"
Expand Down
16 changes: 8 additions & 8 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ type ContractConfig = {
conditionalTokens: string;
};

const MUMBAI_CONTRACTS: ContractConfig = {
exchange: "0x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982E",
negRiskAdapter: "0x9A6930BB811fe3dFE1c35e4502134B38EC54399C",
negRiskExchange: "0x87d1A0DdB4C63a6301916F02090A51a7241571e4",
collateral: "0x2E8DCfE708D44ae2e406a1c02DFE2Fa13012f961",
conditionalTokens: "0x7D8610E9567d2a6C9FBf66a5A13E9Ba8bb120d43",
const AMOY_CONTRACTS: ContractConfig = {
exchange: "0xdFE02Eb6733538f8Ea35D585af8DE5958AD99E40",
negRiskAdapter: "0xd91E80cF2E7be2e162c6513ceD06f1dD0dA35296",
negRiskExchange: "0xC5d563A36AE78145C45a50134d48A1215220f80a",
collateral: "0x9c4e1703476e875070ee25b56a58b008cfb8fa78",
conditionalTokens: "0x69308FB512518e39F9b16112fA8d994F4e2Bf8bB",
};

const MATIC_CONTRACTS: ContractConfig = {
Expand All @@ -29,8 +29,8 @@ const getContractConfig = (chainID: number): ContractConfig => {
switch (chainID) {
case 137:
return MATIC_CONTRACTS;
case 80001:
return MUMBAI_CONTRACTS;
case 80002:
return AMOY_CONTRACTS;
default:
throw new Error("Invalid network");
}
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ export interface Trade {

export enum Chain {
POLYGON = 137,
MUMBAI = 80001,
AMOY = 80002,
}

export interface MarketPrice {
Expand Down
2 changes: 1 addition & 1 deletion tests/headers/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Wallet } from "ethers";
import { ApiKeyCreds, Chain } from "../../src/types";

describe("headers", () => {
const chainId = Chain.MUMBAI;
const chainId = Chain.AMOY;
let wallet: Wallet;
let creds: ApiKeyCreds;
beforeEach(() => {
Expand Down
50 changes: 25 additions & 25 deletions tests/order-builder/helpers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { decimalPlaces, roundDown, roundNormal } from "../../src/utilities";
import { ContractConfig, getContractConfig } from "../../src/config";

describe("helpers", () => {
const chainId = Chain.MUMBAI;
const chainId = Chain.AMOY;
let wallet: Wallet;
let contractConfig: ContractConfig;
beforeEach(() => {
Expand Down Expand Up @@ -1788,7 +1788,7 @@ describe("helpers", () => {

const signedOrder = await createOrder(
wallet,
Chain.MUMBAI,
Chain.AMOY,
SignatureType.EOA,
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
order,
Expand Down Expand Up @@ -1825,7 +1825,7 @@ describe("helpers", () => {

const signedOrder = await createOrder(
wallet,
Chain.MUMBAI,
Chain.AMOY,
SignatureType.EOA,
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
order,
Expand Down Expand Up @@ -1862,7 +1862,7 @@ describe("helpers", () => {

const signedOrder = await createOrder(
wallet,
Chain.MUMBAI,
Chain.AMOY,
SignatureType.EOA,
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
order,
Expand Down Expand Up @@ -1899,7 +1899,7 @@ describe("helpers", () => {

const signedOrder = await createOrder(
wallet,
Chain.MUMBAI,
Chain.AMOY,
SignatureType.EOA,
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
order,
Expand Down Expand Up @@ -1937,7 +1937,7 @@ describe("helpers", () => {

const signedOrder = await createOrder(
wallet,
Chain.MUMBAI,
Chain.AMOY,
SignatureType.POLY_GNOSIS_SAFE,
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
order,
Expand Down Expand Up @@ -1971,7 +1971,7 @@ describe("helpers", () => {

const signedOrder = await createOrder(
wallet,
Chain.MUMBAI,
Chain.AMOY,
SignatureType.POLY_GNOSIS_SAFE,
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
order,
Expand Down Expand Up @@ -2005,7 +2005,7 @@ describe("helpers", () => {

const signedOrder = await createOrder(
wallet,
Chain.MUMBAI,
Chain.AMOY,
SignatureType.POLY_GNOSIS_SAFE,
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
order,
Expand Down Expand Up @@ -2039,7 +2039,7 @@ describe("helpers", () => {

const signedOrder = await createOrder(
wallet,
Chain.MUMBAI,
Chain.AMOY,
SignatureType.POLY_GNOSIS_SAFE,
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
order,
Expand Down Expand Up @@ -2078,7 +2078,7 @@ describe("helpers", () => {

const signedOrder = await createOrder(
wallet,
Chain.MUMBAI,
Chain.AMOY,
SignatureType.EOA,
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
order,
Expand Down Expand Up @@ -2115,7 +2115,7 @@ describe("helpers", () => {

const signedOrder = await createOrder(
wallet,
Chain.MUMBAI,
Chain.AMOY,
SignatureType.EOA,
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
order,
Expand Down Expand Up @@ -2152,7 +2152,7 @@ describe("helpers", () => {

const signedOrder = await createOrder(
wallet,
Chain.MUMBAI,
Chain.AMOY,
SignatureType.EOA,
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
order,
Expand Down Expand Up @@ -2189,7 +2189,7 @@ describe("helpers", () => {

const signedOrder = await createOrder(
wallet,
Chain.MUMBAI,
Chain.AMOY,
SignatureType.EOA,
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
order,
Expand Down Expand Up @@ -2227,7 +2227,7 @@ describe("helpers", () => {

const signedOrder = await createOrder(
wallet,
Chain.MUMBAI,
Chain.AMOY,
SignatureType.POLY_GNOSIS_SAFE,
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
order,
Expand Down Expand Up @@ -2261,7 +2261,7 @@ describe("helpers", () => {

const signedOrder = await createOrder(
wallet,
Chain.MUMBAI,
Chain.AMOY,
SignatureType.POLY_GNOSIS_SAFE,
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
order,
Expand Down Expand Up @@ -2295,7 +2295,7 @@ describe("helpers", () => {

const signedOrder = await createOrder(
wallet,
Chain.MUMBAI,
Chain.AMOY,
SignatureType.POLY_GNOSIS_SAFE,
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
order,
Expand Down Expand Up @@ -2329,7 +2329,7 @@ describe("helpers", () => {

const signedOrder = await createOrder(
wallet,
Chain.MUMBAI,
Chain.AMOY,
SignatureType.POLY_GNOSIS_SAFE,
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
order,
Expand Down Expand Up @@ -3355,7 +3355,7 @@ describe("helpers", () => {

const signedOrder = await createMarketBuyOrder(
wallet,
Chain.MUMBAI,
Chain.AMOY,
SignatureType.EOA,
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
order,
Expand Down Expand Up @@ -3391,7 +3391,7 @@ describe("helpers", () => {

const signedOrder = await createMarketBuyOrder(
wallet,
Chain.MUMBAI,
Chain.AMOY,
SignatureType.EOA,
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
order,
Expand Down Expand Up @@ -3427,7 +3427,7 @@ describe("helpers", () => {

const signedOrder = await createMarketBuyOrder(
wallet,
Chain.MUMBAI,
Chain.AMOY,
SignatureType.EOA,
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
order,
Expand Down Expand Up @@ -3463,7 +3463,7 @@ describe("helpers", () => {

const signedOrder = await createMarketBuyOrder(
wallet,
Chain.MUMBAI,
Chain.AMOY,
SignatureType.EOA,
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
order,
Expand Down Expand Up @@ -3503,7 +3503,7 @@ describe("helpers", () => {

const signedOrder = await createMarketBuyOrder(
wallet,
Chain.MUMBAI,
Chain.AMOY,
SignatureType.EOA,
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
order,
Expand Down Expand Up @@ -3539,7 +3539,7 @@ describe("helpers", () => {

const signedOrder = await createMarketBuyOrder(
wallet,
Chain.MUMBAI,
Chain.AMOY,
SignatureType.EOA,
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
order,
Expand Down Expand Up @@ -3575,7 +3575,7 @@ describe("helpers", () => {

const signedOrder = await createMarketBuyOrder(
wallet,
Chain.MUMBAI,
Chain.AMOY,
SignatureType.EOA,
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
order,
Expand Down Expand Up @@ -3611,7 +3611,7 @@ describe("helpers", () => {

const signedOrder = await createMarketBuyOrder(
wallet,
Chain.MUMBAI,
Chain.AMOY,
SignatureType.EOA,
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
order,
Expand Down
4 changes: 2 additions & 2 deletions tests/signing/eip712.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ describe("eip712", () => {
});

it("buildClobEip712Signature", async () => {
const signature = await buildClobEip712Signature(wallet, Chain.MUMBAI, 10000000, 23);
const signature = await buildClobEip712Signature(wallet, Chain.AMOY, 10000000, 23);
expect(signature).not.null;
expect(signature).not.undefined;
expect(signature).not.empty;
expect(signature).equal(
// eslint-disable-next-line max-len
"0xd91760ebcb14e814e9e12600b9bc7cd6bf13ebc175f6a28538b4925763f94f90012da34dd71290d441c28bc4f9b2281d3eb9ecfd1c9a63db1ce9ca85c89c914c1b",
"0xf62319a987514da40e57e2f4d7529f7bac38f0355bd88bb5adbb3768d80de6c1682518e0af677d5260366425f4361e7b70c25ae232aff0ab2331e2b164a1aedc1b",
);
});
});
16 changes: 8 additions & 8 deletions tests/utilities.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ describe("utilities", () => {
"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80";
const address = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266";
const wallet = new Wallet(privateKey);
const chainId = Chain.MUMBAI;
const chainId = Chain.AMOY;
const owner = "f4f247b7-4ac7-ff29-a152-04fda0a8755a";

it("GTD BUY EOA", async () => {
Expand Down Expand Up @@ -906,7 +906,7 @@ describe("utilities", () => {
"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80";
const address = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266";
const wallet = new Wallet(privateKey);
const chainId = Chain.MUMBAI;
const chainId = Chain.AMOY;
const owner = "f4f247b7-4ac7-ff29-a152-04fda0a8755a";

it("GTD BUY EOA", async () => {
Expand Down Expand Up @@ -1566,7 +1566,7 @@ describe("utilities", () => {
"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80";
const address = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266";
const wallet = new Wallet(privateKey);
const chainId = Chain.MUMBAI;
const chainId = Chain.AMOY;
const owner = "f4f247b7-4ac7-ff29-a152-04fda0a8755a";

it("GTD BUY EOA", async () => {
Expand Down Expand Up @@ -2226,7 +2226,7 @@ describe("utilities", () => {
"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80";
const address = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266";
const wallet = new Wallet(privateKey);
const chainId = Chain.MUMBAI;
const chainId = Chain.AMOY;
const owner = "f4f247b7-4ac7-ff29-a152-04fda0a8755a";

it("GTD BUY EOA", async () => {
Expand Down Expand Up @@ -2888,7 +2888,7 @@ describe("utilities", () => {
"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80";
const address = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266";
const wallet = new Wallet(privateKey);
const chainId = Chain.MUMBAI;
const chainId = Chain.AMOY;
const owner = "f4f247b7-4ac7-ff29-a152-04fda0a8755a";

it("GTD BUY EOA", async () => {
Expand Down Expand Up @@ -3548,7 +3548,7 @@ describe("utilities", () => {
"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80";
const address = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266";
const wallet = new Wallet(privateKey);
const chainId = Chain.MUMBAI;
const chainId = Chain.AMOY;
const owner = "f4f247b7-4ac7-ff29-a152-04fda0a8755a";

it("GTD BUY EOA", async () => {
Expand Down Expand Up @@ -4208,7 +4208,7 @@ describe("utilities", () => {
"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80";
const address = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266";
const wallet = new Wallet(privateKey);
const chainId = Chain.MUMBAI;
const chainId = Chain.AMOY;
const owner = "f4f247b7-4ac7-ff29-a152-04fda0a8755a";

it("GTD BUY EOA", async () => {
Expand Down Expand Up @@ -4868,7 +4868,7 @@ describe("utilities", () => {
"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80";
const address = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266";
const wallet = new Wallet(privateKey);
const chainId = Chain.MUMBAI;
const chainId = Chain.AMOY;
const owner = "f4f247b7-4ac7-ff29-a152-04fda0a8755a";

it("GTD BUY EOA", async () => {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -697,10 +697,10 @@
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"

"@polymarket/order-utils@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@polymarket/order-utils/-/order-utils-2.0.0.tgz#26e2e8311248c19556f5e14d65a8f69f5bc1a98c"
integrity sha512-Ttb/m9bi1kR4ZUkdmtRxM7P7F+gfkseOiM2adAX/wXsebjn1owzZITg34pmRTwDsv89tgLEIkM6aSIDySsa/Gg==
"@polymarket/order-utils@^2.1.0":
version "2.1.0"
resolved "https://registry.yarnpkg.com/@polymarket/order-utils/-/order-utils-2.1.0.tgz#eacf573c139e9e6c59d0244b6e4e52835b687b42"
integrity sha512-vUFj1WiEtm4vB0dxx2NweKKioPu7ehBoJ8fTTaVbR8Dur6AazVWyS+KhgrDE66fKTNneOxxgfdEpbNgxZ4pOIA==
dependencies:
"@metamask/eth-sig-util" "^5.0.0"
ethers "^5.7.1"
Expand Down

0 comments on commit 829af1d

Please sign in to comment.