Skip to content

Commit

Permalink
fix: remove logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Aman035 committed Dec 14, 2023
1 parent 421655c commit 6189b8e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 31 deletions.
25 changes: 8 additions & 17 deletions packages/restapi/src/lib/alias/getAliasInfo.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import axios from 'axios';
import {
getAPIBaseUrls,
getCAIPWithChainId
} from '../helpers';
import { getAPIBaseUrls, getCAIPWithChainId } from '../helpers';
import Constants, { ENV } from '../constants';
import { ALIAS_CHAIN, ALIAS_CHAIN_ID } from '../config';

Expand All @@ -16,32 +13,26 @@ export type GetAliasInfoOptionsType = {
/** name of the alias chain, can be Polygon or BSC or Optimism */
aliasChain: ALIAS_CHAIN;
env?: ENV;
}
};

/**
* Returns the ethereum channel address of the provided alias address along with its verification status
*/

export const getAliasInfo = async (
options : GetAliasInfoOptionsType
) => {
const {
alias,
aliasChain,
env = Constants.ENV.PROD,
} = options || {};
export const getAliasInfo = async (options: GetAliasInfoOptionsType) => {
const { alias, aliasChain, env = Constants.ENV.PROD } = options || {};

const aliasChainId:number = ALIAS_CHAIN_ID[aliasChain][env];
const aliasChainId: number = ALIAS_CHAIN_ID[aliasChain][env];

const _alias = getCAIPWithChainId(alias, aliasChainId, 'Alias');
// console.log(_alias)
const API_BASE_URL = getAPIBaseUrls(env);
const apiEndpoint = `${API_BASE_URL}/v1/alias`;
const requestUrl = `${apiEndpoint}/${_alias}/channel`;

return await axios.get(requestUrl)
return await axios
.get(requestUrl)
.then((response) => response.data)
.catch((err) => {
console.error(`[EPNS-SDK] - API ${requestUrl}: `, err);
});
}
};
2 changes: 1 addition & 1 deletion packages/restapi/src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const ALPHA_FEATURES = {
export const PACKAGE_BUILD = packageJson.version.includes('alpha')
? 'ALPHA'
: 'STABLE';
console.log(PACKAGE_BUILD);

const Constants = {
ENV,
ENCRYPTION_TYPE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ export class PushNotificationBaseClass {
}
return balance;
} catch (error) {
console.log(error);
console.error(error);
throw new Error(JSON.stringify(error));
}
}
Expand Down Expand Up @@ -401,7 +401,6 @@ export class PushNotificationBaseClass {
const approvalTrxPromise = contract!['approve'](spenderAddress, amount);
const approvalTrx = await approvalTrxPromise;
await this.signer?.provider?.waitForTransaction(approvalTrx.hash);
// console.log(approvalTrx.hash)
} else if ('signTypedData' in this.signer!) {
if (!contract.write) {
throw new Error('viem signer is not provided');
Expand All @@ -410,13 +409,12 @@ export class PushNotificationBaseClass {
args: [spenderAddress, amount],
});
const approvalTrxRes = await approvalTrxPromise;
// console.log(approvalTrxRes);
} else {
throw new Error('Unsupported signer');
}
return true;
} catch (error) {
console.log(error);
console.error(error);
return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ const sendVideoCallNotification = async (
callDetails
};

console.log('sendVideoCallNotification', 'videoData', videoData);

const senderAddressInCaip = getCAIPWithChainId(senderAddress, chainId);
const recipientAddressInCaip = getCAIPWithChainId(
recipientAddress,
Expand Down Expand Up @@ -102,7 +100,7 @@ const sendVideoCallNotification = async (
env,
});
} catch (err) {
console.log('Error occured while sending notification for video call', err);
console.error('Error occured while sending notification for video call', err);
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ describe('Create Push Profile with Profile update', () => {
let walletAddress: string;
let account: string;


beforeEach(() => {
provider = ethers.getDefaultProvider(11155111);
const WALLET = ethers.Wallet.createRandom();
Expand All @@ -27,11 +26,11 @@ describe('Create Push Profile with Profile update', () => {
account = `eip155:${walletAddress}`;
});


it('Push Profile V3', async () => {
const name = 'John';
const desc = 'He is web3 dev'
const picture = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvUlEQVR4AcXBsa3CMBiF0Y+rFNarM0Jqi1EoU2QIj+IxPACTuGYEBnAH7Q+FI/SKe87lflxfGAkzYSbMFr7kMoh6TUTb2ph5PHeiXAZRr4lImAkzYbbkMoh6TUTb2vjFtjaiXneiXAaRMBNmwmzhxN9xI+o1MZPL4ENNzAgzYSbMFk70mohyGcz0mviFMBNmwmzhxLY2Pt2Y2dZG9HjuzAgzYSbMLvfj+mIil8F/9JqYEWbCTJgJM2EmzITZG0wkJb/EapQdAAAAAElFTkSuQmCC'
const desc = 'He is web3 dev';
const picture =
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvUlEQVR4AcXBsa3CMBiF0Y+rFNarM0Jqi1EoU2QIj+IxPACTuGYEBnAH7Q+FI/SKe87lflxfGAkzYSbMFr7kMoh6TUTb2ph5PHeiXAZRr4lImAkzYbbkMoh6TUTb2vjFtjaiXneiXAaRMBNmwmzhxN9xI+o1MZPL4ENNzAgzYSbMFk70mohyGcz0mviFMBNmwmzhxLY2Pt2Y2dZG9HjuzAgzYSbMLvfj+mIil8F/9JqYEWbCTJgJM2EmzITZG0wkJb/EapQdAAAAAElFTkSuQmCC';
const user = await createUserWithProfile({
account: account,
env: _env,
Expand All @@ -42,7 +41,6 @@ describe('Create Push Profile with Profile update', () => {
picture: picture,
},
});
console.log(user)
expect(user).to.be.an('object');
expect(user).not.to.be.null;
expect(user).not.to.be.undefined;
Expand All @@ -56,7 +54,7 @@ describe('Create Push Profile with Profile update', () => {
);
expect(user.profile.name).to.be.equal(name);
expect(user.profile.desc).to.be.equal(desc);
expect(user.profile.picture).to.be.equal(picture);;
expect(user.profile.picture).to.be.equal(picture);
expect(user.msgSent).to.be.equal(0);
});
});

0 comments on commit 6189b8e

Please sign in to comment.