@polymarket/clob-client 1.0.0 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -4
- package/dist/client.d.ts +16 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +113 -4
- package/dist/client.js.map +1 -1
- package/dist/{src/constants.d.ts → constants.d.ts} +0 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/{src/constants.js → constants.js} +0 -0
- package/dist/constants.js.map +1 -0
- package/dist/{src/contracts → contracts}/index.d.ts +0 -0
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/{src/contracts → contracts}/index.js +0 -0
- package/dist/contracts/index.js.map +1 -0
- package/dist/{src/endpoints.d.ts → endpoints.d.ts} +0 -0
- package/dist/endpoints.d.ts.map +1 -0
- package/dist/{src/endpoints.js → endpoints.js} +0 -0
- package/dist/endpoints.js.map +1 -0
- package/dist/{src/errors.d.ts → errors.d.ts} +0 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/{src/errors.js → errors.js} +0 -0
- package/dist/errors.js.map +1 -0
- package/dist/{src/headers → headers}/index.d.ts +0 -0
- package/dist/headers/index.d.ts.map +1 -0
- package/dist/{src/headers → headers}/index.js +0 -0
- package/dist/headers/index.js.map +1 -0
- package/dist/{src/http_helpers → http_helpers}/index.d.ts +0 -0
- package/dist/http_helpers/index.d.ts.map +1 -0
- package/dist/{src/http_helpers → http_helpers}/index.js +1 -3
- package/dist/http_helpers/index.js.map +1 -0
- package/dist/{src/order-builder → order-builder}/builder.d.ts +0 -0
- package/dist/order-builder/builder.d.ts.map +1 -0
- package/dist/{src/order-builder → order-builder}/builder.js +0 -0
- package/dist/order-builder/builder.js.map +1 -0
- package/dist/{src/order-builder → order-builder}/constants.d.ts +0 -0
- package/dist/order-builder/constants.d.ts.map +1 -0
- package/dist/{src/order-builder → order-builder}/constants.js +0 -0
- package/dist/order-builder/constants.js.map +1 -0
- package/dist/{src/order-builder → order-builder}/helpers.d.ts +0 -0
- package/dist/order-builder/helpers.d.ts.map +1 -0
- package/dist/{src/order-builder → order-builder}/helpers.js +0 -0
- package/dist/order-builder/helpers.js.map +1 -0
- package/dist/{src/order-builder → order-builder}/index.d.ts +0 -0
- package/dist/order-builder/index.d.ts.map +1 -0
- package/dist/{src/order-builder → order-builder}/index.js +0 -0
- package/dist/order-builder/index.js.map +1 -0
- package/dist/{src/order-builder → order-builder}/utils.d.ts +0 -0
- package/dist/order-builder/utils.d.ts.map +1 -0
- package/dist/{src/order-builder → order-builder}/utils.js +0 -0
- package/dist/order-builder/utils.js.map +1 -0
- package/dist/signing/eip712.d.ts.map +1 -1
- package/dist/signing/hmac.d.ts.map +1 -1
- package/dist/types.d.ts +53 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +6 -0
- package/dist/types.js.map +1 -1
- package/dist/{src/utilities.d.ts → utilities.d.ts} +0 -0
- package/dist/utilities.d.ts.map +1 -0
- package/dist/{src/utilities.js → utilities.js} +0 -0
- package/dist/utilities.js.map +1 -0
- package/package.json +14 -17
- package/dist/examples/createApiKey.d.ts +0 -2
- package/dist/examples/createApiKey.d.ts.map +0 -1
- package/dist/examples/createApiKey.js +0 -19
- package/dist/examples/createApiKey.js.map +0 -1
- package/dist/examples/createOrder.d.ts +0 -2
- package/dist/examples/createOrder.d.ts.map +0 -1
- package/dist/examples/createOrder.js +0 -34
- package/dist/examples/createOrder.js.map +0 -1
- package/dist/examples/getApiKeys.d.ts +0 -2
- package/dist/examples/getApiKeys.d.ts.map +0 -1
- package/dist/examples/getApiKeys.js +0 -23
- package/dist/examples/getApiKeys.js.map +0 -1
- package/dist/examples/getOpenOrders.d.ts +0 -2
- package/dist/examples/getOpenOrders.d.ts.map +0 -1
- package/dist/examples/getOpenOrders.js +0 -23
- package/dist/examples/getOpenOrders.js.map +0 -1
- package/dist/examples/getServerTime.d.ts +0 -2
- package/dist/examples/getServerTime.d.ts.map +0 -1
- package/dist/examples/getServerTime.js +0 -11
- package/dist/examples/getServerTime.js.map +0 -1
- package/dist/examples/getTradeHistory.d.ts +0 -2
- package/dist/examples/getTradeHistory.d.ts.map +0 -1
- package/dist/examples/getTradeHistory.js +0 -23
- package/dist/examples/getTradeHistory.js.map +0 -1
- package/dist/examples/marketOrder.d.ts +0 -2
- package/dist/examples/marketOrder.d.ts.map +0 -1
- package/dist/examples/marketOrder.js +0 -42
- package/dist/examples/marketOrder.js.map +0 -1
- package/dist/examples/testMarketBuy.d.ts +0 -2
- package/dist/examples/testMarketBuy.d.ts.map +0 -1
- package/dist/examples/testMarketBuy.js +0 -50
- package/dist/examples/testMarketBuy.js.map +0 -1
- package/dist/examples/testMarketSell.d.ts +0 -2
- package/dist/examples/testMarketSell.d.ts.map +0 -1
- package/dist/examples/testMarketSell.js +0 -50
- package/dist/examples/testMarketSell.js.map +0 -1
- package/dist/examples/testMultiSigMarketBuy.d.ts +0 -2
- package/dist/examples/testMultiSigMarketBuy.d.ts.map +0 -1
- package/dist/examples/testMultiSigMarketBuy.js +0 -52
- package/dist/examples/testMultiSigMarketBuy.js.map +0 -1
- package/dist/examples/testPolyProxyMarketBuy.d.ts +0 -2
- package/dist/examples/testPolyProxyMarketBuy.d.ts.map +0 -1
- package/dist/examples/testPolyProxyMarketBuy.js +0 -52
- package/dist/examples/testPolyProxyMarketBuy.js.map +0 -1
- package/dist/examples/testPolyProxyMarketSell.d.ts +0 -2
- package/dist/examples/testPolyProxyMarketSell.d.ts.map +0 -1
- package/dist/examples/testPolyProxyMarketSell.js +0 -52
- package/dist/examples/testPolyProxyMarketSell.js.map +0 -1
- package/dist/helpers/index.d.ts +0 -5
- package/dist/helpers/index.d.ts.map +0 -1
- package/dist/helpers/index.js +0 -16
- package/dist/helpers/index.js.map +0 -1
- package/dist/keys.ts/index.d.ts +0 -4
- package/dist/keys.ts/index.d.ts.map +0 -1
- package/dist/keys.ts/index.js +0 -14
- package/dist/keys.ts/index.js.map +0 -1
- package/dist/src/client.d.ts +0 -26
- package/dist/src/client.d.ts.map +0 -1
- package/dist/src/client.js +0 -134
- package/dist/src/client.js.map +0 -1
- package/dist/src/constants.d.ts.map +0 -1
- package/dist/src/constants.js.map +0 -1
- package/dist/src/contracts/index.d.ts.map +0 -1
- package/dist/src/contracts/index.js.map +0 -1
- package/dist/src/endpoints.d.ts.map +0 -1
- package/dist/src/endpoints.js.map +0 -1
- package/dist/src/errors.d.ts.map +0 -1
- package/dist/src/errors.js.map +0 -1
- package/dist/src/headers/index.d.ts.map +0 -1
- package/dist/src/headers/index.js.map +0 -1
- package/dist/src/http_helpers/index.d.ts.map +0 -1
- package/dist/src/http_helpers/index.js.map +0 -1
- package/dist/src/index.d.ts +0 -3
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -3
- package/dist/src/index.js.map +0 -1
- package/dist/src/order-builder/builder.d.ts.map +0 -1
- package/dist/src/order-builder/builder.js.map +0 -1
- package/dist/src/order-builder/constants.d.ts.map +0 -1
- package/dist/src/order-builder/constants.js.map +0 -1
- package/dist/src/order-builder/helpers.d.ts.map +0 -1
- package/dist/src/order-builder/helpers.js.map +0 -1
- package/dist/src/order-builder/index.d.ts.map +0 -1
- package/dist/src/order-builder/index.js.map +0 -1
- package/dist/src/order-builder/utils.d.ts.map +0 -1
- package/dist/src/order-builder/utils.js.map +0 -1
- package/dist/src/signing/constants.d.ts +0 -15
- package/dist/src/signing/constants.d.ts.map +0 -1
- package/dist/src/signing/constants.js +0 -16
- package/dist/src/signing/constants.js.map +0 -1
- package/dist/src/signing/eip712.d.ts +0 -10
- package/dist/src/signing/eip712.d.ts.map +0 -1
- package/dist/src/signing/eip712.js +0 -32
- package/dist/src/signing/eip712.js.map +0 -1
- package/dist/src/signing/hmac.d.ts +0 -10
- package/dist/src/signing/hmac.d.ts.map +0 -1
- package/dist/src/signing/hmac.js +0 -25
- package/dist/src/signing/hmac.js.map +0 -1
- package/dist/src/signing/index.d.ts +0 -3
- package/dist/src/signing/index.d.ts.map +0 -1
- package/dist/src/signing/index.js +0 -3
- package/dist/src/signing/index.js.map +0 -1
- package/dist/src/types.d.ts +0 -71
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/types.js +0 -7
- package/dist/src/types.js.map +0 -1
- package/dist/src/utilities.d.ts.map +0 -1
- package/dist/src/utilities.js.map +0 -1
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { ethers } from "ethers";
|
|
2
|
-
import { config as dotenvConfig } from "dotenv";
|
|
3
|
-
import { resolve } from "path";
|
|
4
|
-
import { ClobClient, Side } from "../src";
|
|
5
|
-
dotenvConfig({ path: resolve(__dirname, "../.env") });
|
|
6
|
-
async function main() {
|
|
7
|
-
const provider = new ethers.providers.JsonRpcProvider(process.env.ETH_RPC_URL);
|
|
8
|
-
const pk = new ethers.Wallet(`${process.env.PK}`);
|
|
9
|
-
const wallet = pk.connect(provider);
|
|
10
|
-
console.log(`Address: ${await wallet.getAddress()}`);
|
|
11
|
-
const host = "http://localhost:8080";
|
|
12
|
-
const creds = {
|
|
13
|
-
key: `${process.env.CLOB_API_KEY}`,
|
|
14
|
-
secret: `${process.env.CLOB_SECRET}`,
|
|
15
|
-
passphrase: `${process.env.CLOB_PASS_PHRASE}`,
|
|
16
|
-
};
|
|
17
|
-
const clobClient = new ClobClient(host, wallet, creds);
|
|
18
|
-
// Create a buy order for 100 YES for 0.50c
|
|
19
|
-
const order = await clobClient.createLimitOrder({
|
|
20
|
-
asset: {
|
|
21
|
-
address: "0xadbeD21409324e0fcB80AE8b5e662B0C857D85ed",
|
|
22
|
-
condition: "YES",
|
|
23
|
-
},
|
|
24
|
-
price: 0.5,
|
|
25
|
-
side: Side.BUY,
|
|
26
|
-
size: 100,
|
|
27
|
-
});
|
|
28
|
-
// Send it to the server
|
|
29
|
-
const resp = await clobClient.postLimitOrder(order);
|
|
30
|
-
console.log(resp);
|
|
31
|
-
console.log(`Done!`);
|
|
32
|
-
}
|
|
33
|
-
main();
|
|
34
|
-
//# sourceMappingURL=createOrder.js.map
|
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AK,EAAE;YACH,OAAO,EAAE,4CAA4C;YACrD,SAAS,EAAE,KAAK;SACnB;QACD,KAAK,EAAE,GAAG;QACV,IAAI,EAAE,IAAI,CAAC,GAAG;QACd,IAAI,EAAE,GAAG;KACZ,CAAC,CAAC;IAEH,wBAAwB;IACxB,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IACpD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAClB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AAED,IAAI,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getApiKeys.d.ts","sourceRoot":"","sources":["../../examples/getApiKeys.ts"],"names":[],"mappings":""}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ethers } from "ethers";
|
|
2
|
-
import { config as dotenvConfig } from "dotenv";
|
|
3
|
-
import { resolve } from "path";
|
|
4
|
-
import { ClobClient } from "../src";
|
|
5
|
-
dotenvConfig({ path: resolve(__dirname, "../.env") });
|
|
6
|
-
async function main() {
|
|
7
|
-
const provider = new ethers.providers.JsonRpcProvider(process.env.ETH_RPC_URL);
|
|
8
|
-
const pk = new ethers.Wallet(`${process.env.PK}`);
|
|
9
|
-
const wallet = pk.connect(provider);
|
|
10
|
-
console.log(`Address: ${await wallet.getAddress()}`);
|
|
11
|
-
const host = "http://localhost:8080";
|
|
12
|
-
const creds = {
|
|
13
|
-
key: `${process.env.CLOB_API_KEY}`,
|
|
14
|
-
secret: `${process.env.CLOB_SECRET}`,
|
|
15
|
-
passphrase: `${process.env.CLOB_PASS_PHRASE}`,
|
|
16
|
-
};
|
|
17
|
-
const clobClient = new ClobClient(host, wallet, creds);
|
|
18
|
-
console.log(`Response: `);
|
|
19
|
-
const resp = await clobClient.getApiKeys();
|
|
20
|
-
console.log(resp);
|
|
21
|
-
}
|
|
22
|
-
main();
|
|
23
|
-
//# source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,GAAG,MAAM,UAAU,CAAC,UAAU,EAAE,CAAC;IAC3C,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACtB,CAAC;AAED,IAAI,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getOpenOrders.d.ts","sourceRoot":"","sources":["../../examples/getOpenOrders.ts"],"names":[],"mappings":""}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ethers } from "ethers";
|
|
2
|
-
import { config as dotenvConfig } from "dotenv";
|
|
3
|
-
import { resolve } from "path";
|
|
4
|
-
import { ClobClient } from "../src";
|
|
5
|
-
dotenvConfig({ path: resolve(__dirname, "../.env") });
|
|
6
|
-
async function main() {
|
|
7
|
-
const provider = new ethers.providers.JsonRpcProvider(process.env.ETH_RPC_URL);
|
|
8
|
-
const pk = new ethers.Wallet(`${process.env.PK}`);
|
|
9
|
-
const wallet = pk.connect(provider);
|
|
10
|
-
console.log(`Address: ${await wallet.getAddress()}`);
|
|
11
|
-
const host = "http://localhost:8080";
|
|
12
|
-
const creds = {
|
|
13
|
-
key: `${process.env.CLOB_API_KEY}`,
|
|
14
|
-
secret: `${process.env.CLOB_SECRET}`,
|
|
15
|
-
passphrase: `${process.env.CLOB_PASS_PHRASE}`,
|
|
16
|
-
};
|
|
17
|
-
const clobClient = new ClobClient(host, wallet, creds);
|
|
18
|
-
const resp = await clobClient.getOpenOrders();
|
|
19
|
-
console.log(resp);
|
|
20
|
-
console.log(`Done!`);
|
|
21
|
-
}
|
|
22
|
-
main();
|
|
23
|
-
//# sourceMappingURL=getOpenOrders.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getOpenOrders.js","sourceRoot":"","sources":["../../examples/getOpenOrders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,QAAQ,CAAC;AAChD,OA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 -1,11 +0,0 @@
|
|
|
1
|
-
import { config as dotenvConfig } from "dotenv";
|
|
2
|
-
import { resolve } from "path";
|
|
3
|
-
import { ClobClient } from "../src";
|
|
4
|
-
dotenvConfig({ path: resolve(__dirname, "../.env") });
|
|
5
|
-
async function main() {
|
|
6
|
-
const host = "http://localhost:8080";
|
|
7
|
-
const clobClient = new ClobClient(host);
|
|
8
|
-
console.log(`Server time: ${await clobClient.getServerTime()}`);
|
|
9
|
-
}
|
|
10
|
-
main();
|
|
11
|
-
//# sourceMappingURL=getServerTime.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getServerTime.js","sourceRoot":"","sources":["../../examples/getServerTime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC;AAEtD,KAAK,UAAU,IAAI;IACf,MAAM,IAAI,GAAG,uBAAuB,CAAC;IACrC,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;IAExC,OAAO,CAAC,GAAG,CAAC,gBAAgB,MAAM,UAAU,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;AACpE,CAAC;AAED,IAAI,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getTradeHistory.d.ts","sourceRoot":"","sources":["../../examples/getTradeHistory.ts"],"names":[],"mappings":""}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ethers } from "ethers";
|
|
2
|
-
import { config as dotenvConfig } from "dotenv";
|
|
3
|
-
import { resolve } from "path";
|
|
4
|
-
import { ClobClient } from "../src";
|
|
5
|
-
dotenvConfig({ path: resolve(__dirname, "../.env") });
|
|
6
|
-
async function main() {
|
|
7
|
-
const provider = new ethers.providers.JsonRpcProvider(process.env.ETH_RPC_URL);
|
|
8
|
-
const pk = new ethers.Wallet(`${process.env.PK}`);
|
|
9
|
-
const wallet = pk.connect(provider);
|
|
10
|
-
console.log(`Address: ${await wallet.getAddress()}`);
|
|
11
|
-
const host = "http://localhost:8080";
|
|
12
|
-
const creds = {
|
|
13
|
-
key: `${process.env.CLOB_API_KEY}`,
|
|
14
|
-
secret: `${process.env.CLOB_SECRET}`,
|
|
15
|
-
passphrase: `${process.env.CLOB_PASS_PHRASE}`,
|
|
16
|
-
};
|
|
17
|
-
const clobClient = new ClobClient(host, wallet, creds);
|
|
18
|
-
console.log(`Response: `);
|
|
19
|
-
const resp = await clobClient.getTradeHistory();
|
|
20
|
-
console.log(resp);
|
|
21
|
-
}
|
|
22
|
-
main();
|
|
23
|
-
//# sourceMappingURL=getTradeHistory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getTradeHistory.js","sourceRoot":"","sources":["../../examples/getTradeHistory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAe,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEjD,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC;AAEtD,KAAK,UAAU,IAAI;IACf,MAAM,QAAQ,GAAG,IAAI,MAAM,CAAC,SAAS,CAAC,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAC/E,MAAM,EAAE,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;IAClD,MAAM,MAAM,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACpC,OAAO,CAAC,GAAG,CAAC,YAAY,MAAM,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAErD,MAAM,IAAI,GAAG,uBAAuB,CAAC;IACrC,MAAM,KAAK,GAAgB;QACvB,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE;QAClC,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE;QACpC,UAAU,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE;KAChD,CAAC;IACF,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAEvD,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAC1B,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,eAAe,EAAE,CAAC;IAChD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACtB,CAAC;AAED,IAAI,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"marketOrder.d.ts","sourceRoot":"","sources":["../../examples/marketOrder.ts"],"names":[],"mappings":""}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { ethers } from "ethers";
|
|
2
|
-
import { config as dotenvConfig } from "dotenv";
|
|
3
|
-
import { resolve } from "path";
|
|
4
|
-
import { ClobClient, Side } from "../src";
|
|
5
|
-
dotenvConfig({ path: resolve(__dirname, "../.env") });
|
|
6
|
-
async function main() {
|
|
7
|
-
const provider = new ethers.providers.JsonRpcProvider(process.env.ETH_RPC_URL);
|
|
8
|
-
const pk = new ethers.Wallet(`${process.env.PK}`);
|
|
9
|
-
const wallet = pk.connect(provider);
|
|
10
|
-
console.log(`Address: ${await wallet.getAddress()}`);
|
|
11
|
-
const host = "http://localhost:8080";
|
|
12
|
-
const creds = {
|
|
13
|
-
key: `${process.env.CLOB_API_KEY}`,
|
|
14
|
-
secret: `${process.env.CLOB_SECRET}`,
|
|
15
|
-
passphrase: `${process.env.CLOB_PASS_PHRASE}`,
|
|
16
|
-
};
|
|
17
|
-
const clobClient = new ClobClient(host, wallet, creds);
|
|
18
|
-
// Create a market sell order for 150 YES tokens
|
|
19
|
-
const order = await clobClient.createMarketOrder({
|
|
20
|
-
asset: {
|
|
21
|
-
address: "0xadbeD21409324e0fcB80AE8b5e662B0C857D85ed",
|
|
22
|
-
condition: "YES",
|
|
23
|
-
},
|
|
24
|
-
side: Side.SELL,
|
|
25
|
-
size: 150,
|
|
26
|
-
});
|
|
27
|
-
// const order = await clobClient.createMarketOrder({
|
|
28
|
-
// asset: {
|
|
29
|
-
// address: "0xadbeD21409324e0fcB80AE8b5e662B0C857D85ed",
|
|
30
|
-
// condition: "YES",
|
|
31
|
-
// },
|
|
32
|
-
// side: Side.BUY,
|
|
33
|
-
// size: 150,
|
|
34
|
-
// type: OrderType.MARKET,
|
|
35
|
-
// });
|
|
36
|
-
// Send it to the server
|
|
37
|
-
const resp = await clobClient.postMarketOrder(order);
|
|
38
|
-
console.log(resp);
|
|
39
|
-
console.log(`Done!`);
|
|
40
|
-
}
|
|
41
|
-
main();
|
|
42
|
-
//# sourceMappingURL=marketOrder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"marketOrder.js","sourceRoot":"","sources":["../../examples/marketOrder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAe,UAAU,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEvD,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC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AC;IAClB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AAED,IAAI,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"testMarketBuy.d.ts","sourceRoot":"","sources":["../../examples/testMarketBuy.ts"],"names":[],"mappings":""}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { ethers } from "ethers";
|
|
2
|
-
import { config as dotenvConfig } from "dotenv";
|
|
3
|
-
import { resolve } from "path";
|
|
4
|
-
import { ClobClient, Side } from "../src";
|
|
5
|
-
dotenvConfig({ path: resolve(__dirname, "../.env") });
|
|
6
|
-
async function populateBook(client) {
|
|
7
|
-
const orders = [
|
|
8
|
-
{ side: Side.SELL, price: 0.75, size: 100 },
|
|
9
|
-
{ side: Side.SELL, price: 0.5, size: 100 },
|
|
10
|
-
];
|
|
11
|
-
for (const newOrder of orders) {
|
|
12
|
-
await client.postLimitOrder(await client.createLimitOrder({
|
|
13
|
-
asset: {
|
|
14
|
-
address: "0xadbeD21409324e0fcB80AE8b5e662B0C857D85ed",
|
|
15
|
-
condition: "YES",
|
|
16
|
-
},
|
|
17
|
-
side: newOrder.side,
|
|
18
|
-
price: newOrder.price,
|
|
19
|
-
size: newOrder.size,
|
|
20
|
-
}));
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
async function market(client) {
|
|
24
|
-
await client.postMarketOrder(await client.createMarketOrder({
|
|
25
|
-
asset: {
|
|
26
|
-
address: "0xadbeD21409324e0fcB80AE8b5e662B0C857D85ed",
|
|
27
|
-
condition: "YES",
|
|
28
|
-
},
|
|
29
|
-
side: Side.BUY,
|
|
30
|
-
size: 150,
|
|
31
|
-
}));
|
|
32
|
-
}
|
|
33
|
-
async function main() {
|
|
34
|
-
const provider = new ethers.providers.JsonRpcProvider(process.env.ETH_RPC_URL);
|
|
35
|
-
const pk = new ethers.Wallet(`${process.env.PK}`);
|
|
36
|
-
const wallet = pk.connect(provider);
|
|
37
|
-
console.log(`Address: ${await wallet.getAddress()}`);
|
|
38
|
-
const host = "http://localhost:8080";
|
|
39
|
-
const creds = {
|
|
40
|
-
key: `${process.env.CLOB_API_KEY}`,
|
|
41
|
-
secret: `${process.env.CLOB_SECRET}`,
|
|
42
|
-
passphrase: `${process.env.CLOB_PASS_PHRASE}`,
|
|
43
|
-
};
|
|
44
|
-
const clobClient = new ClobClient(host, wallet, creds);
|
|
45
|
-
await populateBook(clobClient);
|
|
46
|
-
await market(clobClient);
|
|
47
|
-
console.log(`Done!`);
|
|
48
|
-
}
|
|
49
|
-
main();
|
|
50
|
-
//# sourceMappingURL=testMarketBuy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"testMarketBuy.js","sourceRoot":"","sources":["../../examples/testMarketBuy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAe,UAAU,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEvD,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC;AAEtD,KAAK,UAAU,YAAY,CAAC,MAAkB;IAC1C,MAAM,MAAM,GAAG;QACX,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE;QAC3C,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE;KAC7C,CAAC;IAEF,KAAK,MAAM,QAAQ,IAAI,MAAM,EAAE;QAC3B,MAAM,MAAM,CAAC,cAAc,CACvB,MAAM,MAAM,CAAC,gBAAgB,CAAC;YAC1B,KAAK,EAAE;gB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,UAAU,CAAC,CAAC;IAC/B,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC;IAEzB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AAED,IAAI,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"testMarketSell.d.ts","sourceRoot":"","sources":["../../examples/testMarketSell.ts"],"names":[],"mappings":""}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { ethers } from "ethers";
|
|
2
|
-
import { config as dotenvConfig } from "dotenv";
|
|
3
|
-
import { resolve } from "path";
|
|
4
|
-
import { ClobClient, Side } from "../src";
|
|
5
|
-
dotenvConfig({ path: resolve(__dirname, "../.env") });
|
|
6
|
-
async function populateBook(client) {
|
|
7
|
-
const orders = [
|
|
8
|
-
{ side: Side.BUY, price: 0.4, size: 100 },
|
|
9
|
-
{ side: Side.BUY, price: 0.5, size: 100 },
|
|
10
|
-
];
|
|
11
|
-
for (const newOrder of orders) {
|
|
12
|
-
await client.postLimitOrder(await client.createLimitOrder({
|
|
13
|
-
asset: {
|
|
14
|
-
address: "0xadbeD21409324e0fcB80AE8b5e662B0C857D85ed",
|
|
15
|
-
condition: "YES",
|
|
16
|
-
},
|
|
17
|
-
side: newOrder.side,
|
|
18
|
-
price: newOrder.price,
|
|
19
|
-
size: newOrder.size,
|
|
20
|
-
}));
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
async function market(client) {
|
|
24
|
-
await client.postMarketOrder(await client.createMarketOrder({
|
|
25
|
-
asset: {
|
|
26
|
-
address: "0xadbeD21409324e0fcB80AE8b5e662B0C857D85ed",
|
|
27
|
-
condition: "YES",
|
|
28
|
-
},
|
|
29
|
-
side: Side.SELL,
|
|
30
|
-
size: 150,
|
|
31
|
-
}));
|
|
32
|
-
}
|
|
33
|
-
async function main() {
|
|
34
|
-
const provider = new ethers.providers.JsonRpcProvider(process.env.ETH_RPC_URL);
|
|
35
|
-
const pk = new ethers.Wallet(`${process.env.PK}`);
|
|
36
|
-
const wallet = pk.connect(provider);
|
|
37
|
-
console.log(`Address: ${await wallet.getAddress()}`);
|
|
38
|
-
const host = "http://localhost:8080";
|
|
39
|
-
const creds = {
|
|
40
|
-
key: `${process.env.CLOB_API_KEY}`,
|
|
41
|
-
secret: `${process.env.CLOB_SECRET}`,
|
|
42
|
-
passphrase: `${process.env.CLOB_PASS_PHRASE}`,
|
|
43
|
-
};
|
|
44
|
-
const clobClient = new ClobClient(host, wallet, creds);
|
|
45
|
-
await populateBook(clobClient);
|
|
46
|
-
await market(clobClient);
|
|
47
|
-
console.log(`Done!`);
|
|
48
|
-
}
|
|
49
|
-
main();
|
|
50
|
-
//# sourceMappingURL=testMarketSell.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"testMarketSell.js","sourceRoot":"","sources":["../../examples/testMarketSell.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAe,UAAU,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEvD,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC;AAEtD,KAAK,UAAU,YAAY,CAAC,MAAkB;IAC1C,MAAM,MAAM,GAAG;QACX,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE;QACzC,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE;KAC5C,CAAC;IAEF,KAAK,MAAM,QAAQ,IAAI,MAAM,EAAE;QAC3B,MAAM,MAAM,CAAC,cAAc,CACvB,M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MAAM,EAAE,KAAK,CAAC,CAAC;IACvD,MAAM,YAAY,CAAC,UAAU,CAAC,CAAC;IAC/B,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC;IAEzB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AAED,IAAI,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"testMultiSigMarketBuy.d.ts","sourceRoot":"","sources":["../../examples/testMultiSigMarketBuy.ts"],"names":[],"mappings":""}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { ethers } from "ethers";
|
|
2
|
-
import { config as dotenvConfig } from "dotenv";
|
|
3
|
-
import { resolve } from "path";
|
|
4
|
-
import { ClobClient, Side, SignatureType } from "../src";
|
|
5
|
-
dotenvConfig({ path: resolve(__dirname, "../.env") });
|
|
6
|
-
async function populateBook(client) {
|
|
7
|
-
const orders = [
|
|
8
|
-
{ side: Side.SELL, price: 0.75, size: 100 },
|
|
9
|
-
{ side: Side.SELL, price: 0.5, size: 100 },
|
|
10
|
-
];
|
|
11
|
-
for (const newOrder of orders) {
|
|
12
|
-
await client.postLimitOrder(await client.createLimitOrder({
|
|
13
|
-
asset: {
|
|
14
|
-
address: "0xadbeD21409324e0fcB80AE8b5e662B0C857D85ed",
|
|
15
|
-
condition: "YES",
|
|
16
|
-
},
|
|
17
|
-
side: newOrder.side,
|
|
18
|
-
price: newOrder.price,
|
|
19
|
-
size: newOrder.size,
|
|
20
|
-
}));
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
async function market(client) {
|
|
24
|
-
await client.postMarketOrder(await client.createMarketOrder({
|
|
25
|
-
asset: {
|
|
26
|
-
address: "0xadbeD21409324e0fcB80AE8b5e662B0C857D85ed",
|
|
27
|
-
condition: "YES",
|
|
28
|
-
},
|
|
29
|
-
side: Side.BUY,
|
|
30
|
-
size: 150,
|
|
31
|
-
}));
|
|
32
|
-
}
|
|
33
|
-
async function main() {
|
|
34
|
-
const provider = new ethers.providers.JsonRpcProvider(process.env.ETH_RPC_URL);
|
|
35
|
-
const pk = new ethers.Wallet(`${process.env.PK}`);
|
|
36
|
-
const wallet = pk.connect(provider);
|
|
37
|
-
console.log(`Address: ${await wallet.getAddress()}`);
|
|
38
|
-
const host = "http://localhost:8080";
|
|
39
|
-
const creds = {
|
|
40
|
-
key: `${process.env.CLOB_API_KEY}`,
|
|
41
|
-
secret: `${process.env.CLOB_SECRET}`,
|
|
42
|
-
passphrase: `${process.env.CLOB_PASS_PHRASE}`,
|
|
43
|
-
};
|
|
44
|
-
// Create a clob client, using the CONTRACT signature scheme
|
|
45
|
-
// and providing a multisig as funder address
|
|
46
|
-
const clobPolyClient = new ClobClient(host, wallet, creds, SignatureType.CONTRACT, "0x5cc0c75CdB2235b453e22c9882fAa6945cD6Ec71");
|
|
47
|
-
await populateBook(clobPolyClient);
|
|
48
|
-
await market(clobPolyClient);
|
|
49
|
-
console.log(`Done!`);
|
|
50
|
-
}
|
|
51
|
-
main();
|
|
52
|
-
//# sourceMappingURL=testMultiSigMarketBuy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"testMultiSigMarketBuy.js","sourceRoot":"","sources":["../../examples/testMultiSigMarketBuy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAe,UAAU,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEtE,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC;AAEtD,KAAK,UAAU,YAAY,CAAC,MAAkB;IAC1C,MAAM,MAAM,GAAG;QACX,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAA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,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE;QAClC,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE;QACpC,UAAU,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE;KAChD,CAAC;IAEF,4DAA4D;IAC5D,6CAA6C;IAC7C,MAAM,cAAc,GAAG,IAAI,UAAU,CACjC,IAAI,EACJ,MAAM,EACN,KAAK,EACL,aAAa,CAAC,QAAQ,EACtB,4CAA4C,CAC/C,CAAC;IAEF,MAAM,YAAY,CAAC,cAAc,CAAC,CAAC;IACnC,MAAM,MAAM,CAAC,cAAc,CAAC,CAAC;IAE7B,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AAED,IAAI,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"testPolyProxyMarketBuy.d.ts","sourceRoot":"","sources":["../../examples/testPolyProxyMarketBuy.ts"],"names":[],"mappings":""}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { ethers } from "ethers";
|
|
2
|
-
import { config as dotenvConfig } from "dotenv";
|
|
3
|
-
import { resolve } from "path";
|
|
4
|
-
import { ClobClient, Side, SignatureType } from "../src";
|
|
5
|
-
dotenvConfig({ path: resolve(__dirname, "../.env") });
|
|
6
|
-
async function populateBook(client) {
|
|
7
|
-
const orders = [
|
|
8
|
-
{ side: Side.BUY, price: 0.4, size: 100 },
|
|
9
|
-
{ side: Side.BUY, price: 0.5, size: 100 },
|
|
10
|
-
];
|
|
11
|
-
for (const newOrder of orders) {
|
|
12
|
-
await client.postLimitOrder(await client.createLimitOrder({
|
|
13
|
-
asset: {
|
|
14
|
-
address: "0xadbeD21409324e0fcB80AE8b5e662B0C857D85ed",
|
|
15
|
-
condition: "YES",
|
|
16
|
-
},
|
|
17
|
-
side: newOrder.side,
|
|
18
|
-
price: newOrder.price,
|
|
19
|
-
size: newOrder.size,
|
|
20
|
-
}));
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
async function market(client) {
|
|
24
|
-
await client.postMarketOrder(await client.createMarketOrder({
|
|
25
|
-
asset: {
|
|
26
|
-
address: "0xadbeD21409324e0fcB80AE8b5e662B0C857D85ed",
|
|
27
|
-
condition: "YES",
|
|
28
|
-
},
|
|
29
|
-
side: Side.SELL,
|
|
30
|
-
size: 150,
|
|
31
|
-
}));
|
|
32
|
-
}
|
|
33
|
-
async function main() {
|
|
34
|
-
const provider = new ethers.providers.JsonRpcProvider(process.env.ETH_RPC_URL);
|
|
35
|
-
const pk = new ethers.Wallet(`${process.env.PK}`);
|
|
36
|
-
const wallet = pk.connect(provider);
|
|
37
|
-
console.log(`Address: ${await wallet.getAddress()}`);
|
|
38
|
-
const host = "http://localhost:8080";
|
|
39
|
-
const creds = {
|
|
40
|
-
key: `${process.env.CLOB_API_KEY}`,
|
|
41
|
-
secret: `${process.env.CLOB_SECRET}`,
|
|
42
|
-
passphrase: `${process.env.CLOB_PASS_PHRASE}`,
|
|
43
|
-
};
|
|
44
|
-
// Create a clob client, using the poly proxy signature scheme
|
|
45
|
-
// and providing the proxy address
|
|
46
|
-
const clobPolyClient = new ClobClient(host, wallet, creds, SignatureType.POLY_PROXY, "0xb57af06b944df7df17b9661652f72b954286ee07");
|
|
47
|
-
await populateBook(clobPolyClient);
|
|
48
|
-
await market(clobPolyClient);
|
|
49
|
-
console.log(`Done!`);
|
|
50
|
-
}
|
|
51
|
-
main();
|
|
52
|
-
//# sourceMappingURL=testPolyProxyMarketBuy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"testPolyProxyMarketBuy.js","sourceRoot":"","sources":["../../examples/testPolyProxyMarketBuy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAA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,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;IAClD,MAAM,MAAM,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACpC,OAAO,CAAC,GAAG,CAAC,YAAY,MAAM,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAErD,MAAM,IAAI,GAAG,uBAAuB,CAAC;IACrC,MAAM,KAAK,GAAgB;QACvB,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE;QAClC,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE;QACpC,UAAU,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE;KAChD,CAAC;IAEF,8DAA8D;IAC9D,kCAAkC;IAClC,MAAM,cAAc,GAAG,IAAI,UAAU,CACjC,IAAI,EACJ,MAAM,EACN,KAAK,EACL,aAAa,CAAC,UAAU,EACxB,4CAA4C,CAC/C,CAAC;IAEF,MAAM,YAAY,CAAC,cAAc,CAAC,CAAC;IACnC,MAAM,MAAM,CAAC,cAAc,CAAC,CAAC;IAE7B,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AAED,IAAI,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"testPolyProxyMarketSell.d.ts","sourceRoot":"","sources":["../../examples/testPolyProxyMarketSell.ts"],"names":[],"mappings":""}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { ethers } from "ethers";
|
|
2
|
-
import { config as dotenvConfig } from "dotenv";
|
|
3
|
-
import { resolve } from "path";
|
|
4
|
-
import { ClobClient, Side, SignatureType } from "../src";
|
|
5
|
-
dotenvConfig({ path: resolve(__dirname, "../.env") });
|
|
6
|
-
async function populateBook(client) {
|
|
7
|
-
const orders = [
|
|
8
|
-
{ side: Side.SELL, price: 0.75, size: 100 },
|
|
9
|
-
{ side: Side.SELL, price: 0.5, size: 100 },
|
|
10
|
-
];
|
|
11
|
-
for (const newOrder of orders) {
|
|
12
|
-
await client.postLimitOrder(await client.createLimitOrder({
|
|
13
|
-
asset: {
|
|
14
|
-
address: "0xadbeD21409324e0fcB80AE8b5e662B0C857D85ed",
|
|
15
|
-
condition: "YES",
|
|
16
|
-
},
|
|
17
|
-
side: newOrder.side,
|
|
18
|
-
price: newOrder.price,
|
|
19
|
-
size: newOrder.size,
|
|
20
|
-
}));
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
async function market(client) {
|
|
24
|
-
await client.postMarketOrder(await client.createMarketOrder({
|
|
25
|
-
asset: {
|
|
26
|
-
address: "0xadbeD21409324e0fcB80AE8b5e662B0C857D85ed",
|
|
27
|
-
condition: "YES",
|
|
28
|
-
},
|
|
29
|
-
side: Side.BUY,
|
|
30
|
-
size: 150,
|
|
31
|
-
}));
|
|
32
|
-
}
|
|
33
|
-
async function main() {
|
|
34
|
-
const provider = new ethers.providers.JsonRpcProvider(process.env.ETH_RPC_URL);
|
|
35
|
-
const pk = new ethers.Wallet(`${process.env.PK}`);
|
|
36
|
-
const wallet = pk.connect(provider);
|
|
37
|
-
console.log(`Address: ${await wallet.getAddress()}`);
|
|
38
|
-
const host = "http://localhost:8080";
|
|
39
|
-
const creds = {
|
|
40
|
-
key: `${process.env.CLOB_API_KEY}`,
|
|
41
|
-
secret: `${process.env.CLOB_SECRET}`,
|
|
42
|
-
passphrase: `${process.env.CLOB_PASS_PHRASE}`,
|
|
43
|
-
};
|
|
44
|
-
// Create a clob client, using the poly proxy signature scheme
|
|
45
|
-
// and providing the proxy address
|
|
46
|
-
const clobPolyClient = new ClobClient(host, wallet, creds, SignatureType.POLY_PROXY, "0xb57af06b944df7df17b9661652f72b954286ee07");
|
|
47
|
-
await populateBook(clobPolyClient);
|
|
48
|
-
await market(clobPolyClient);
|
|
49
|
-
console.log(`Done!`);
|
|
50
|
-
}
|
|
51
|
-
main();
|
|
52
|
-
//# sourceMappingURL=testPolyProxyMarketSell.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"testPolyProxyMarketSell.js","sourceRoot":"","sources":["../../examples/testPolyProxyMarketSell.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAe,UAAU,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEtE,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC;AAEtD,KAAK,UAAU,YAAY,CAAC,MAAkB;IAC1C,MAAM,MAAM,GAAG;QACX,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE;QAC3C,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE;KAC7C,CAAC;IAEF,KAAK,MAAM,QAAQ,IAAI,MAAM,EAAE;QAC3B,MAAM,MAAM,CAAC,cAAc,CACvB,MAAM,MAAM,CAAC,gBAAgB,CAAC;YAC1B,KAAK,EAAE;gBACH,OAAO,EAAE,4CAA4C;gBACrD,SAAS,EAAE,KAAK;aACnB;YACD,IAAI,EAAE,QAAQ,CAAC,IAAI;YACnB,KAAK,EAAE,QAAQ,CAAC,KAAK;YACrB,IAAI,EAAE,QAAQ,CAAC,IAAI;SACtB,CAAC,CACL,CAAC;KACL;AACL,CAAC;AAED,KAAK,UAAU,MAAM,CAAC,MAAkB;IACpC,MAAM,MAAM,CAAC,eAAe,CACxB,MAAM,MAAM,CAAC,iBAAiB,CAAC;QAC3B,KAAK,EAAE;YACH,OAAO,EAAE,4CAA4C;YACrD,SAAS,EAAE,KAAK;SACnB;QACD,IAAI,EAAE,IAAI,CAAC,GAAG;QACd,IAAI,EAAE,GAAG;KACZ,CAAC,CACL,CAAC;AACN,CAAC;AAED,KAAK,UAAU,IAAI;IACf,MAAM,QAAQ,GAAG,IAAI,MAAM,CAAC,SAAS,CAAC,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAC/E,MAAM,EAAE,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;IAClD,MAAM,MAAM,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACpC,OAAO,CAAC,GAAG,CAAC,YAAY,MAAM,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAErD,MAAM,IAAI,GAAG,uBAAuB,CAAC;IACrC,MAAM,KAAK,GAAgB;QACvB,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE;QAClC,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE;QACpC,UAAU,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE;KAChD,CAAC;IAEF,8DAA8D;IAC9D,kCAAkC;IAClC,MAAM,cAAc,GAAG,IAAI,UAAU,CACjC,IAAI,EACJ,MAAM,EACN,KAAK,EACL,aAAa,CAAC,UAAU,EACxB,4CAA4C,CAC/C,CAAC;IAEF,MAAM,YAAY,CAAC,cAAc,CAAC,CAAC;IACnC,MAAM,MAAM,CAAC,cAAc,CAAC,CAAC;IAE7B,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AAED,IAAI,EAAE,CAAC"}
|
package/dist/helpers/index.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Method } from "axios";
|
|
2
|
-
export declare const request: (endpoint: string, method: Method, headers?: any, data?: any) => Promise<any>;
|
|
3
|
-
export declare const post: (endpoint: string, headers?: any, data?: any) => Promise<any>;
|
|
4
|
-
export declare const get: (endpoint: string, headers?: any, data?: any) => Promise<any>;
|
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEtC,eAAO,MAAM,OAAO,aAAoB,MAAM,UAAU,MAAM,YAAY,GAAG,SAAS,GAAG,KAAG,OAAO,CAAC,GAAG,CAOtG,CAAC;AAEF,eAAO,MAAM,IAAI,aAAoB,MAAM,YAAY,GAAG,SAAS,GAAG,KAAG,OAAO,CAAC,GAAG,CAEnF,CAAC;AAEF,eAAO,MAAM,GAAG,aAAoB,MAAM,YAAY,GAAG,SAAS,GAAG,KAAG,OAAO,CAAC,GAAG,CAElF,CAAC"}
|
package/dist/helpers/index.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import axios from "axios";
|
|
2
|
-
export const request = async (endpoint, method, headers, data) => {
|
|
3
|
-
return axios({
|
|
4
|
-
method,
|
|
5
|
-
url: endpoint,
|
|
6
|
-
headers,
|
|
7
|
-
data,
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
export const post = async (endpoint, headers, data) => {
|
|
11
|
-
return request(endpoint, "POST", headers, data);
|
|
12
|
-
};
|
|
13
|
-
export const get = async (endpoint, headers, data) => {
|
|
14
|
-
return request(endpoint, "GET", headers, data);
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAEtC,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,EAAE,QAAgB,EAAE,MAAc,EAAE,OAAa,EAAE,IAAU,EAAgB,EAAE;IACvG,OAAO,KAAK,CAAC;QACT,MAAM;QACN,GAAG,EAAE,QAAQ;QACb,OAAO;QACP,IAAI;KACP,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAG,KAAK,EAAE,QAAgB,EAAE,OAAa,EAAE,IAAU,EAAgB,EAAE;IACpF,OAAO,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;AACpD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,GAAG,GAAG,KAAK,EAAE,QAAgB,EAAE,OAAa,EAAE,IAAU,EAAgB,EAAE;IACnF,OAAO,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;AACnD,CAAC,CAAC"}
|
package/dist/keys.ts/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/keys.ts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAI/C,eAAO,MAAM,YAAY,aAAoB,MAAM,UAAU,MAAM,GAAG,aAAa,KAAG,OAAO,CAAC,GAAG,CAWhG,CAAC"}
|
package/dist/keys.ts/index.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { post } from "../helpers";
|
|
2
|
-
import { buildClobEip712Signature } from "../signing";
|
|
3
|
-
export const createApiKey = async (endpoint, signer) => {
|
|
4
|
-
const now = Math.floor(Date.now() / 1000);
|
|
5
|
-
const sig = await buildClobEip712Signature(signer, now);
|
|
6
|
-
const address = await signer.getAddress();
|
|
7
|
-
const headers = {
|
|
8
|
-
POLY_ADDRESS: address,
|
|
9
|
-
POLY_SIGNATURE: sig,
|
|
10
|
-
POLY_TIMESTAMP: `${now}`,
|
|
11
|
-
};
|
|
12
|
-
return post(endpoint, headers);
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/keys.ts/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAEtD,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAAE,QAAgB,EAAE,MAA8B,EAAgB,EAAE;IACjG,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;IAC1C,MAAM,GAAG,GAAG,MAAM,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACxD,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC;IAE1C,MAAM,OAAO,GAAG;QACZ,YAAY,EAAE,OAAO;QACrB,cAAc,EAAE,GAAG;QACnB,cAAc,EAAE,GAAG,GAAG,EAAE;KAC3B,CAAC;IACF,OAAO,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACnC,CAAC,CAAC"}
|