Skip to content

Commit

Permalink
🐛 fix: add ex3 api url (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
rustin01 authored Aug 1, 2024
1 parent 14d03bc commit 3058eac
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 30 deletions.
1 change: 1 addition & 0 deletions apps/wallet/.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
VITE_APP_ENV=Mainnet
VITE_RELEASE_VERSION=v1.0
VITE_HIBIT_ID_API=https://api.hibit.app/
VITE_EX3_API=https://api.hibit.app/
VITE_TELEGRAM_BOT_ID=6944468360
VITE_SYSTEM_MAX_DECIMALS=8
VITE_OIDC_REFRESH_TOKEN_TIMEOUT=3600000
1 change: 1 addition & 0 deletions apps/wallet/.env.development
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ VITE_HIBIT_ID_API=https://testnetidapi.hibit.app/
#VITE_HIBIT_ID_API=https://localhost:54397/
VITE_HIBIT_AUTH_SERVER=https://testnetauth.hibit.app/
#VITE_HIBIT_AUTH_SERVER=https://localhost:44383/
VITE_EX3_API=https://alphaapi.ex3.one/
VITE_HIBIT_AUTH_CLIENT_ID=hibit_id_local
VITE_TELEGRAM_BOT_ID=6944468360
VITE_SYSTEM_MAX_DECIMALS=8
Expand Down
31 changes: 1 addition & 30 deletions apps/wallet/src/apis/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface ServiceRequestConfig<T> extends AxiosRequestConfig {
}

const ex3ApiRequest = axios.create({
baseURL: import.meta.env.VITE_HIBIT_ID_API,
baseURL: import.meta.env.VITE_EX3_API,
timeout: 10000,
headers: {
'Content-Type': 'application/json',
Expand Down Expand Up @@ -53,35 +53,6 @@ export const authServiceClient = async <D>(config: ServiceRequestConfig<D>) => {
return JSON.stringify(res.data)
};

export const sendEx3WalletRequest = async <TInput>(
input: TInput,
url: string
): Promise<string> => {
let dataStr = '';
// to json if not string
if (typeof input !== 'string') {
const timestamp = parseInt(new Date().getTime().toString());
const contextData = {
...input,
timestamp: timestamp
};
dataStr = JSON.stringify(contextData);
} else {
dataStr = input;
}
const walletSignature = await hibitIdSession.wallet?.signMessage(dataStr);
return await ex3ServiceClient({
url: url,
method: 'POST',
data: {
chain: '60',
chainNetwork: '11155111',
message: dataStr,
signature: walletSignature
}
});
}

export const sendEx3UnSignedRequest = async <TInput>(
input: TInput,
url: string
Expand Down

0 comments on commit 3058eac

Please sign in to comment.