Skip to content

Commit

Permalink
Merge pull request #351 from masa-finance/h34d/chore/remove-middleware
Browse files Browse the repository at this point in the history
chore (middlware login): Use analytics api to login from now on
  • Loading branch information
H34D committed Aug 6, 2024
2 parents 6175cf0 + bb9cdc0 commit 8989821
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/masa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class Masa implements MasaInterface {
public constructor({
cookie,
signer,
apiUrl = "https://middleware.masa.finance",
apiUrl = "https://api.cookiemonster.masa.finance",
environment = "production",
networkName = "ethereum",
arweave = {
Expand Down
2 changes: 1 addition & 1 deletion src/modules/soul-linker/query-link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const queryLink = async (
signature,
);

console.log("tx hash for middleware", txHash);
console.log("tx hash for backend", txHash);

const { "tokenURI(uint256)": tokenURI } = contract;

Expand Down
14 changes: 7 additions & 7 deletions src/utils/clients/masa-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const headers = {
};

export class MasaClient extends MasaBase {
private _middlewareClient: AxiosInstance;
private _apiClient: AxiosInstance;
private _cookie?: string;

get cookie() {
Expand All @@ -37,7 +37,7 @@ export class MasaClient extends MasaBase {
super(masa);
this._cookie = cookie;

this._middlewareClient = axios.create({
this._apiClient = axios.create({
baseURL: apiUrl,
withCredentials: true,
headers,
Expand Down Expand Up @@ -72,7 +72,7 @@ export class MasaClient extends MasaBase {

const cookieToUse = cookie || this.cookie;

const checkSignatureResponse = await this._middlewareClient
const checkSignatureResponse = await this._apiClient
.post<
{
address: string;
Expand Down Expand Up @@ -129,7 +129,7 @@ export class MasaClient extends MasaBase {
getChallenge: async (): Promise<ChallengeResultWithCookie | undefined> => {
let result;

const getChallengeResponse = await this._middlewareClient
const getChallengeResponse = await this._apiClient
.get<ChallengeResult>("/session/get-challenge")
.catch((error: Error | AxiosError) => {
console.error("Get Challenge failed!", error.message);
Expand Down Expand Up @@ -195,7 +195,7 @@ export class MasaClient extends MasaBase {
console.log(`Posting '${JSON.stringify(data)}' to '${endpoint}'`);
}

const postResponse = await this._middlewareClient
const postResponse = await this._apiClient
.post<Request, AxiosResponse<Result>>(endpoint, data, {
withCredentials: true,
headers: {
Expand Down Expand Up @@ -243,7 +243,7 @@ export class MasaClient extends MasaBase {
console.log(`Patching '${JSON.stringify(data)}' to '${endpoint}'`);
}

const patchResponse = await this._middlewareClient
const patchResponse = await this._apiClient
.patch<Request, AxiosResponse<Result>>(endpoint, data, {
withCredentials: true,
headers: {
Expand Down Expand Up @@ -290,7 +290,7 @@ export class MasaClient extends MasaBase {
console.log(`Getting '${endpoint}'`);
}

const getResponse = await this._middlewareClient
const getResponse = await this._apiClient
.get<Result>(endpoint, {
withCredentials: true,
headers: {
Expand Down
6 changes: 3 additions & 3 deletions src/utils/environments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const environments: Environment[] = [
} as Environment,
{
environment: "dev",
apiUrl: "https://dev.middleware.masa.finance/",
apiUrl: "https://dev.api.cookiemonster.masa.finance/",
networkName: "sepolia",
arweave: {
host: "arweave.net",
Expand All @@ -32,7 +32,7 @@ export const environments: Environment[] = [
} as Environment,
{
environment: "stage",
apiUrl: "https://beta.middleware.masa.finance/",
apiUrl: "https://stage.api.cookiemonster.masa.finance/",
networkName: "sepolia",
arweave: {
host: "arweave.net",
Expand All @@ -43,7 +43,7 @@ export const environments: Environment[] = [
} as Environment,
{
environment: "production",
apiUrl: "https://middleware.masa.finance/",
apiUrl: "https://api.cookiemonster.masa.finance/",
networkName: "ethereum",
arweave: {
host: "arweave.net",
Expand Down

0 comments on commit 8989821

Please sign in to comment.