approveAgent — Signature verification fails on both Testnet and Mainnet despite correct EIP-712 parameters
Repository: asterdex / asterdex-api-docs (or wherever the official SDK/docs live)
Summary
Calling POST /fapi/v3/approveAgent always returns a signature verification error regardless of the signing approach used. We have verified the EIP-712 domain, field types, field order, chain ID, and nonce format across multiple attempts on both Testnet and Mainnet. The signature is rejected every time.
Environment
| Property |
Testnet |
Mainnet |
| Endpoint |
fapi.asterdex-testnet.com |
fapi.asterdex.com |
| Signing method |
eth_signTypedData_v4 |
eth_signTypedData_v4 |
| Wallet |
MetaMask (browser) |
MetaMask (browser) |
| Network (BNB) |
Chain 97 |
Chain 56 |
| Library |
ethers.js v6 |
ethers.js v6 |
What we tried
Attempt 1 — Full 10-field type (matching Python demo aster-code.py)
ApproveAgent: [
{ name: 'AgentName', type: 'string' },
{ name: 'AgentAddress', type: 'string' },
{ name: 'IpWhitelist', type: 'string' },
{ name: 'Expired', type: 'uint256' },
{ name: 'CanSpotTrade', type: 'bool' },
{ name: 'CanPerpTrade', type: 'bool' },
{ name: 'CanWithdraw', type: 'bool' },
{ name: 'AsterChain', type: 'string' },
{ name: 'User', type: 'string' },
{ name: 'Nonce', type: 'uint256' },
]
→ Result: Signature check failed
Attempt 2 — 5-field type (inferred from official site MetaMask prompt)
Observed the MetaMask popup on www.asterdex-testnet.com which displayed exactly 5 fields:
Primary type: ApproveAgent
AsterChain: Testnet
AgentAddress: 0x...
AgentName: @aster-desktop
Nonce: 1777380555670000
Expired: 1779972555668
Updated our type to match:
ApproveAgent: [
{ name: 'AsterChain', type: 'string' },
{ name: 'AgentAddress', type: 'string' },
{ name: 'AgentName', type: 'string' },
{ name: 'Nonce', type: 'uint256' },
{ name: 'Expired', type: 'uint256' },
]
→ Result: Signature check failed
Attempt 3 — Domain chainId variations tried
| chainId tried |
Reasoning |
56 |
Python eip712_template uses 56 |
97 |
Observed network in official MetaMask prompt (BNB Testnet) |
714 |
AsterChain Testnet chain ID |
1666 |
API docs reference |
→ All result in: Signature check failed
Attempt 4 — Nonce format variations
| Format |
Example value |
Date.now() (ms) |
1714240000123 |
Math.floor(Date.now()/1000) * 1_000_000 (Python style, µs) |
1714240000000000 |
Date.now() * 1000 (ms → µs) |
1714240123000 |
The official site's MetaMask prompt shows 1777380555670000 — consistent with Date.now() * 1000.
→ All result in: Signature check failed at the API level.
Exact request being sent
POST /fapi/v3/approveAgent
Content-Type: application/x-www-form-urlencoded
agentName=mybot
&agentAddress=0x...
&ipWhitelist=
&expired=1779972555668
&canSpotTrade=false
&canPerpTrade=false
&canWithdraw=false
&asterChain=Testnet
&user=0x...
&nonce=1714240123000000
&signature=0x...
&signatureChainId=56
Questions
- What is the exact EIP-712 type definition (
ApproveAgent fields, types, and order) the server uses to verify the signature?
- What
chainId should the EIP-712 domain use — is it the BNB chain ID (97/56) or an Aster-specific ID (714/1666)?
- What is the expected nonce format — milliseconds, microseconds, or something else?
- Are all body parameters included in the signed message, or only a subset?
- Is there a working JavaScript/TypeScript code example for
approveAgent using eth_signTypedData_v4?
References
- Official Python demo:
aster-code.py (sign_v3_eip712 + send_by_url)
- API docs:
POST /fapi/v3/approveAgent
- MetaMask screenshot from
www.asterdex-testnet.com showing the 5-field prompt
approveAgent— Signature verification fails on both Testnet and Mainnet despite correct EIP-712 parametersRepository:
asterdex/asterdex-api-docs(or wherever the official SDK/docs live)Summary
Calling
POST /fapi/v3/approveAgentalways returns a signature verification error regardless of the signing approach used. We have verified the EIP-712 domain, field types, field order, chain ID, and nonce format across multiple attempts on both Testnet and Mainnet. The signature is rejected every time.Environment
fapi.asterdex-testnet.comfapi.asterdex.cometh_signTypedData_v4eth_signTypedData_v4What we tried
Attempt 1 — Full 10-field type (matching Python demo
aster-code.py)→ Result:
Signature check failedAttempt 2 — 5-field type (inferred from official site MetaMask prompt)
Observed the MetaMask popup on
www.asterdex-testnet.comwhich displayed exactly 5 fields:Updated our type to match:
→ Result:
Signature check failedAttempt 3 — Domain
chainIdvariations tried56eip712_templateuses 56977141666→ All result in:
Signature check failedAttempt 4 — Nonce format variations
Date.now()(ms)1714240000123Math.floor(Date.now()/1000) * 1_000_000(Python style, µs)1714240000000000Date.now() * 1000(ms → µs)1714240123000The official site's MetaMask prompt shows
1777380555670000— consistent withDate.now() * 1000.→ All result in:
Signature check failedat the API level.Exact request being sent
Questions
ApproveAgentfields, types, and order) the server uses to verify the signature?chainIdshould the EIP-712 domain use — is it the BNB chain ID (97/56) or an Aster-specific ID (714/1666)?approveAgentusingeth_signTypedData_v4?References
aster-code.py(sign_v3_eip712+send_by_url)POST /fapi/v3/approveAgentwww.asterdex-testnet.comshowing the 5-field prompt