Signing Permit - eth_signTypeData_v4

Question. So I have a script to sign permit from my backend and it works on local server RPC. Now when I use BSC Testnet or Main RPCs I get a failure that ‘Method Not Allowed’. Am I doing something wrong?

Thanks.

import { signDaiPermit } from 'eth-permit';
....
 const result = await signDaiPermit(connection, PepperBirdAddress, signer1.address, signer0.address);
 {
  reason: 'bad response',
  code: 'SERVER_ERROR',
  status: 401,
  headers: {
    date: 'Wed, 16 Mar 2022 02:39:13 GMT',
    'content-type': 'text/plain',
    'content-length': '18',
    connection: 'close',
    'cf-cache-status': 'DYNAMIC',
    'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"',
    server: 'cloudflare',
    'cf-ray': '6eca1dfe69605c4d-IAD'
  },
  body: 'Method not allowed',
  requestBody: '{"method":"eth_signTypedData_v4","params":["0x99dC06743520A091031eb9E1b4f4CA53Dc70ED70","{\\"types\\":{\\"EIP712Domain\\":[{\\"name\\":\\"name\\",\\"type\\":\\"string\\"},{\\"name\\":\\"version\\",\\"type\\":\\"string\\"},{\\"name\\":\\"chainId\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"verifyi
ngContract\\",\\"type\\":\\"address\\"}],\\"Permit\\":[{\\"name\\":\\"holder\\",\\"type\\":\\"address\\"},{\\"name\\":\\"spender\\",\\"type\\":\\"address\\"},{\\"name\\":\\"nonce\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"expiry\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"allowed\\",\\"type\\":\\"bool\\"}]},\\
"primaryType\\":\\"Permit\\",\\"domain\\":{\\"name\\":\\"PEPPERBIRD\\",\\"version\\":\\"1\\",\\"chainId\\":\\"0x38\\",\\"verifyingContract\\":\\"0x1a641542AEa88bcE799FCa4090Ce534A0F67d990\\"},\\"message\\":{\\"holder\\":\\"0x99dC06743520A091031eb9E1b4f4CA53Dc70ED70\\",\\"spender\\":\\"0x489eebc806c96d83fbEABd62
195C5BC299c0Dfed\\",\\"nonce\\":\\"0x0000000000000000000000000000000000000000000000000000000000000000\\",\\"expiry\\":\\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\\",\\"allowed\\":true}}"],"id":58,"jsonrpc":"2.0"}',
  requestMethod: 'POST',
  url: 'https://speedy-nodes-nyc.moralis.io/a33fce50b94a01d137e905bf/bsc/mainnet'
}

Hi, I have the same issue. Have you resolved it? Thanks.

This may clear things up: https://forum.openzeppelin.com/t/providererror-the-method-eth-signtypeddata-v4-does-not-exist-is-not-available/16929/2

More details about your environment and what libraries you’re using, etc. would help.

@thisIsKareemG looks like you are using speedy nodes, which if get method not allowed means that we block such functionality. Speedy nodes after all is mostly used mainly on the backend for deploying smart contracts :raised_hands:

@stephenko11 not sure what RPC url you’re using or what error did you get