diff --git a/src/app/components/auth/services/auth.service.ts b/src/app/components/auth/services/auth.service.ts index c1e950b..9b99cc5 100644 --- a/src/app/components/auth/services/auth.service.ts +++ b/src/app/components/auth/services/auth.service.ts @@ -25,6 +25,7 @@ import { NzNotificationService } from 'ng-zorro-antd/notification'; import { BehaviorSubject, firstValueFrom, skip, Subscription } from 'rxjs'; import { MemberApi, TokenDistributionWithAirdrops } from './../../../@api/member.api'; import { removeItem } from './../../../@core/utils/local-storage.utils'; +import { environment } from '@env/environment'; const tanglePay = (window as any).iota; export interface MetamaskSignature { @@ -206,7 +207,7 @@ export class AuthService { public async sign(params: any = {}, cb: SignCallback): Promise { this.showWalletPopup$.next(WalletStatus.ACTIVE); // We support either resign with metamask or reuse token. - let sc: WenRequest | undefined | false = undefined; + let sc: any | undefined | false = undefined; const customToken: any = getItem(StorageItem.CustomToken); const wallet = customToken.wallet || Wallets.Metamask; // check it's not expired. @@ -214,6 +215,7 @@ export class AuthService { sc = { address: customToken.address, customToken: customToken.value, + projectApiKey: environment.build5Token, body: params, }; } else if (customToken) { @@ -271,7 +273,7 @@ export class AuthService { return true; } - private async signWithMetamask(params: any = {}): Promise { + private async signWithMetamask(params: any = {}): Promise { const provider: any = await detectEthereumProvider(); if (provider) { try { @@ -319,6 +321,7 @@ export class AuthService { return { address: provider.selectedAddress, signature: signature, + projectApiKey: environment.build5Token, body: params, }; } catch (e) { @@ -389,9 +392,10 @@ export class AuthService { }, }); - const returnObj: WenRequest = { + const returnObj: any = { address: currentAddress, signature: signature, + projectApiKey: environment.build5Token, body: params, }; diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index de026de..1a80548 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -5,4 +5,5 @@ export const environment = { key: 'ed51a01fc204688339e89ac8e9d53028', }, soonaversePlaceholder: 'https://soonaverse.com/favicon.ico', + build5Token: '', }; diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 5a30516..04785f6 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -5,4 +5,6 @@ export const environment = { key: '5c053a0370395f0fe8cf7ce9e5a21a72', }, soonaversePlaceholder: 'https://soonaverse.com/favicon.ico', + build5Token: + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiIweDU1MWZkMmM3YzdiZjM1NmJhYzE5NDU4N2RhYjJmY2Q0NjQyMDA1NGIiLCJwcm9qZWN0IjoiMHg0NjIyM2VkZDQxNTc2MzVkZmM2Mzk5MTU1NjA5ZjMwMWRlY2JmZDg4IiwiaWF0IjoxNjk1ODUyNTk2fQ.WT9L4H9eDdFfJZMrfxTKhEq4PojNWSGNv_CbmlG9sJg', };