Skip to content

Commit

Permalink
fix(swagger): add workaround to get transaction details of GAAttachTx
Browse files Browse the repository at this point in the history
  • Loading branch information
davidyuk committed Apr 28, 2021
1 parent 1d83f1a commit bb7ec47
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/utils/swagger.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ export default async (specUrl, { internalUrl, disableBigNumbers, keysOfValuesToI
return SwaggerClient({
url,
spec,
requestInterceptor: request => {
if (
isAeternityNode &&
/^\/v3\/transactions\/\w+$/.test(new URL(request.url).pathname)
) {
return { ...request, url: request.url.replace('v3', 'v2') }
}
return request
},
responseInterceptor: response => {
if (!response.text) return response
const body = pascalizeKeys(jsonImp.parse(response.text), keysOfValuesToIgnore)
Expand Down

0 comments on commit bb7ec47

Please sign in to comment.