Error
When making requests to Goby in establishing a connection, sending a transaction, Making an Offer, or Create an Offer, Goby may respond with an error. Here are the error codes and their meanings. These are inspired the corresponding by EIP-1474 and EIP-1193 on Ethereum.
Code | Title | Descriptioncol |
---|---|---|
4900 | Disconnected | Goby could not connect to the network. |
4100 | Unauthorized | The requested method and/or account has not been authorized by the user. |
4001 | User Rejected Request | The user rejected the request through Goby. |
-32000 | Invalid Input | Missing or invalid parameters. |
-32003 | Transaction Rejected | Goby does not recognize a valid transaction. |
-32601 | Method Not Found | Goby does not identify the method. |
-32603 | Internal Error | Something went wrong within Goby. |
Typically, these errors will be easily parseable and have both a code and an explanation. For example:
try { const accounts = await window.chia.request({ method: "requestAccounts" });} catch (err) { // {code: 4100, message: 'The requested method and/or account has not been authorized by the user.'}}