秋田预测市场 · Discord 审计

TypeScript SDK 订单签名地址不匹配错误

2026-06-25 · Polymarket · 5 条相关讨论

Bishal9 2026-06-25 15:19:20

Hi everyone, I'm trying to place an order using the Polymarket TypeScript SDK, following the Quickstart documentation. I'm creating the client like this: ```ts const account = privateKeyToAccount(POLYMARKET_PRIVATE_KEY); const url = `${ALCHEMY_POLYGON_REST_BASE_URL}/v2/${ALCHEMY_API_KEY}`; const signer = createWalletClient({ account, transport: http(url) }); const client = new ClobClient({ host: POLYMARKET_CLOB_REST_BASE_URL, chain: 137, builderConfig: { builderCode: POLYMARKET_BUILDER_CODE, }, signer, creds: { key: global.POLYMARKET_ACCOUNT.API_KEY, secret: global.POLYMARKET_ACCOUNT.SECRET, passphrase: global.POLYMARKET_ACCOUNT.PASSPHRASE, }, signatureType: SignatureTypeV2.POLY_1271, funderAddress: POLYMARKET_DEPOSIT_WALLET_ADDRESS, }); await client.createAndPostOrder( { price: 0.2, side: Side.BUY, size: 5, tokenID: "VALID_TOKEN_ID", builderCode: POLYMARKET_BUILDER_CODE, }, { negRisk: true, tickSize: "0.01", }, OrderType.GTC, true, true, ); ``` However, I get the following error: ```json { "error": "the order signer address has to be the address of the API KEY", "status": 400 } ``` A few additional details: * The API key, secret, and passphrase were generated using `.createOrDeriveApiKey()`. * The private key is the one obtained from the Polymarket web portal/account page (I'm not using a different wallet's private key). * I'm using `SignatureTypeV2.POLY_1271`. Based on the error, it seems the signer address doesn't match the address associated with the API key, but I'm not sure how to verify that or whether there's an additional setup step required when using `POLY_1271`. I'm following the Quickstart docs here: https://docs.polymarket.com/trading/quickstart Has anyone encountered this before or knows what I might be missing? Thanks!

Hi everyone, I'm trying to place an order using the Polymarket TypeScript SDK, following the Quickstart documentation. I'm creating the client like this: ```ts const account = privateKeyToAccount(POLYMARKET_PRIVATE_KEY); const url = `${ALCHEMY_POLYGON_REST_BASE_URL}/v2/${ALCHEMY_API_KEY}`; const signer = createWalletClient({ account, transport: http(url) }); const client = new ClobClient({ host: POLYMARKET_CLOB_REST_BASE_URL, chain: 137, builderConfig: { builderCode: POLYMARKET_BUILDER_CODE, }, signer, creds: { key: global.POLYMARKET_ACCOUNT.API_KEY, secret: global.POLYMARKET_ACCOUNT.SECRET, passphrase: global.POLYMARKET_ACCOUNT.PASSPHRASE, }, signatureType: SignatureTypeV2.POLY_1271, funderAddress: POLYMARKET_DEPOSIT_WALLET_ADDRESS, }); await client.createAndPostOrder( { price: 0.2, side: Side.BUY, size: 5, tokenID: "VALID_TOKEN_ID", builderCode: POLYMARKET_BUILDER_CODE, }, { negRisk: true, tickSize: "0.01", }, OrderType.GTC, true, true, ); ``` However, I get the following error: ```json { "error": "the order signer address has to be the address of the API KEY", "status": 400 } ``` A few additional details: * The API key, secret, and passphrase were generated using `.createOrDeriveApiKey()`. * The private key is the one obtained from the Polymarket web portal/account page (I'm not using a different wallet's private key). * I'm using `SignatureTypeV2.POLY_1271`. Based on the error, it seems the signer address doesn't match the address associated with the API key, but I'm not sure how to verify that or whether there's an additional setup step required when using `POLY_1271`. I'm following the Quickstart docs here: https://docs.polymarket.com/trading/quickstart Has anyone encountered this before or knows what I might be missing? Thanks!

diesel power 2026-06-25 15:27:12

Hey. Take a look at this answer https://discord.com/channels/710897173927297116/782024576275447848/1509615422196944896

Hey. Take a look at this answer https://discord.com/channels/710897173927297116/782024576275447848/1509615422196944896

Bishal9 2026-06-25 15:28:14

Should I post my message on that channel again?

Should I post my message on that channel again?

diesel power 2026-06-25 15:28:36

you can but did you check the answer I sent you?

you can but did you check the answer I sent you?

Bishal9 2026-06-25 15:31:57

The signer getting Private Key should be collect from the Deposit Wallet?

The signer getting Private Key should be collect from the Deposit Wallet?