Skip to content

Commit

Permalink
Merge pull request #4201 from BitGo/WIN-1640-solve-opeth-issue
Browse files Browse the repository at this point in the history
fix(sdk-coin-opeth): fix recover methods
  • Loading branch information
sachushaji authored Jan 19, 2024
2 parents 7a48d4e + 13264d8 commit ed0f9d8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions modules/sdk-coin-opeth/src/opeth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,18 @@ export class Opeth extends AbstractEthLikeNewCoins {
}

/**
* Make a query to Arbiscan for information such as balance, token balance, solidity calls
* Make a query to Optimism Etherscan for information such as balance, token balance, solidity calls
* @param {Object} query key-value pairs of parameters to append after /api
* @returns {Promise<Object>} response from Arbiscan
* @returns {Promise<Object>} response from Optimism Etherscan
*/
async recoveryBlockchainExplorerQuery(query: Record<string, string>): Promise<Record<string, unknown>> {
const token = common.Environments[this.bitgo.getEnv()].optimisticEtherscanApiToken;
if (token) {
query.apikey = token;
}
const response = await request.get(common.Environments[this.bitgo.getEnv()].arbiscanBaseUrl + '/api').query(query);
const response = await request
.get(common.Environments[this.bitgo.getEnv()].optimisticEtherscanBaseUrl + '/api')
.query(query);

if (!response.ok) {
throw new Error('could not reach Optimism Etherscan');
Expand Down
2 changes: 1 addition & 1 deletion modules/sdk-coin-opeth/test/unit/opeth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ describe('Optimism', function () {
});

describe('Recover transaction:', function () {
const baseUrl = 'https://api-sepolia.arbiscan.io';
const baseUrl = 'https://api-sepolia-optimistic.etherscan.io';
const userXpub =
'xpub661MyMwAqRbcEeTc8789MK5PUGEYiPG4F4V17n2Rd2LoTATA1XoCnJT5FAYAShQxSxtFjpo5NHmcWwTp2LiWGBMwpUcAA3HywhxivgYfq7q';
const userXprv =
Expand Down

0 comments on commit ed0f9d8

Please sign in to comment.