( error: unknown, )
| 192 | } |
| 193 | |
| 194 | export const getFreebuffGateErrorKind = ( |
| 195 | error: unknown, |
| 196 | ): FreebuffGateErrorKind | null => { |
| 197 | if (!error || typeof error !== 'object') return null |
| 198 | const errorCode = (error as { error?: unknown }).error |
| 199 | const statusCode = (error as { statusCode?: unknown }).statusCode |
| 200 | if (typeof errorCode !== 'string') return null |
| 201 | const expected = FREEBUFF_GATE_STATUS[errorCode as FreebuffGateErrorKind] |
| 202 | if (expected === undefined || statusCode !== expected) return null |
| 203 | return errorCode as FreebuffGateErrorKind |
| 204 | } |
| 205 | |
| 206 | export const OUT_OF_CREDITS_MESSAGE = `Out of credits. Please add credits at ${defaultAppUrl}/usage` |
| 207 |
no outgoing calls
no test coverage detected