docs: sync with docs.polymarket.com - 2026-05-08
This commit is contained in:
@@ -51,7 +51,8 @@ L1 methods require the client to initialize with a signer.
|
||||
</Tabs>
|
||||
|
||||
<Warning>
|
||||
Never commit private keys to version control. Always use environment variables or a secure key management system.
|
||||
Never commit private keys to version control. Always use environment variables
|
||||
or a secure key management system.
|
||||
</Warning>
|
||||
|
||||
***
|
||||
@@ -256,7 +257,8 @@ async createMarketOrder(
|
||||
</ResponseField>
|
||||
|
||||
<ResponseField name="amount" type="number">
|
||||
The order amount. For BUY orders this is a dollar amount; for SELL orders this is the number of shares.
|
||||
The order amount. For BUY orders this is a dollar amount; for SELL orders this
|
||||
is the number of shares.
|
||||
</ResponseField>
|
||||
|
||||
<ResponseField name="side" type="Side">
|
||||
@@ -268,7 +270,8 @@ async createMarketOrder(
|
||||
</ResponseField>
|
||||
|
||||
<ResponseField name="orderType" type="OrderType.FOK | OrderType.FAK">
|
||||
Optional order type, either FOK (Fill-Or-Kill) or FAK (Fill-And-Kill). Optional.
|
||||
Optional order type, either FOK (Fill-Or-Kill) or FAK (Fill-And-Kill).
|
||||
Optional.
|
||||
</ResponseField>
|
||||
|
||||
<ResponseField name="salt" type="string">
|
||||
@@ -353,12 +356,15 @@ async createMarketOrder(
|
||||
<Accordion title="Error - Invalid Funder Address">
|
||||
Your funder address is incorrect or doesn't match your wallet.
|
||||
|
||||
**Solution:** Check your proxy wallet address at [polymarket.com/settings](https://polymarket.com/settings). If it doesn't exist, the user has never logged in to Polymarket.com — deploy the proxy wallet first before creating L2 credentials.
|
||||
**Solution:** New API users should use the deposit wallet address as the
|
||||
funder with signature type `3`. Existing Safe and Proxy users should use
|
||||
their current smart-wallet address.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Lost API credentials but have nonce">
|
||||
Use `deriveApiKey()` with the original nonce:
|
||||
|
||||
```typescript theme={null}
|
||||
// Use deriveApiKey with the original nonce
|
||||
const recovered = await client.deriveApiKey(originalNonce);
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
@@ -25,14 +25,15 @@ L2 methods require the client to initialize with a signer, signature type, API c
|
||||
secret: process.env.SECRET,
|
||||
passphrase: process.env.PASSPHRASE,
|
||||
};
|
||||
const depositWalletAddress = process.env.DEPOSIT_WALLET_ADDRESS!;
|
||||
|
||||
const client = new ClobClient({
|
||||
host: "https://clob.polymarket.com",
|
||||
chain: 137,
|
||||
signer,
|
||||
creds: apiCreds,
|
||||
signatureType: 2, // GNOSIS_SAFE
|
||||
funderAddress: process.env.FUNDER_ADDRESS,
|
||||
signatureType: 3, // POLY_1271
|
||||
funderAddress: depositWalletAddress,
|
||||
});
|
||||
|
||||
// Ready to send authenticated requests
|
||||
@@ -57,8 +58,8 @@ L2 methods require the client to initialize with a signer, signature type, API c
|
||||
chain_id=137,
|
||||
key=os.getenv("PRIVATE_KEY"),
|
||||
creds=api_creds,
|
||||
signature_type=2, # GNOSIS_SAFE
|
||||
funder=os.getenv("FUNDER_ADDRESS")
|
||||
signature_type=3, # POLY_1271
|
||||
funder=os.getenv("DEPOSIT_WALLET_ADDRESS")
|
||||
)
|
||||
|
||||
# Ready to send authenticated requests
|
||||
@@ -518,7 +519,8 @@ async getTrades(
|
||||
</ResponseField>
|
||||
|
||||
<ResponseField name="maker_orders" type="MakerOrder[]">
|
||||
Array of maker order objects that participated in this trade. Each `MakerOrder` contains the following fields:
|
||||
Array of maker order objects that participated in this trade. Each
|
||||
`MakerOrder` contains the following fields:
|
||||
</ResponseField>
|
||||
|
||||
<ResponseField name="maker_orders[].order_id" type="string">
|
||||
|
||||
Reference in New Issue
Block a user