Skip to content

Commit

Permalink
Remove unused apiUrl method and increase timeout on post requests
Browse files Browse the repository at this point in the history
  • Loading branch information
tombeynon committed Jan 13, 2025
1 parent 6fa3626 commit 0fe28df
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/utils/RestClient.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,12 @@ const RestClient = async (chainId, restUrls, opts) => {
};

function simulate(params){
return client.post(apiPath('tx', `simulate`), params)
return client.post(apiPath('tx', `simulate`), params, { timeout: 30000 })
.then((res) => res.data)
}

function broadcast(params){
return client.post(apiPath('tx', `txs`), params)
return client.post(apiPath('tx', `txs`), params, { timeout: 30000 })
.then((res) => parseTxResult(res.data.tx_response))
}

Expand Down Expand Up @@ -392,10 +392,6 @@ const RestClient = async (chainId, restUrls, opts) => {
}
}

function apiUrl(type, path){
return restUrl + apiPath(type, path)
}

function apiPath(type, path){
const version = config.apiVersions[type] || 'v1beta1'
return `/cosmos/${type}/${version}/${path}`
Expand Down

0 comments on commit 0fe28df

Please sign in to comment.