Skip to content

Commit 0f711d9

Browse files
committed
lint
1 parent 58afb9b commit 0f711d9

File tree

25 files changed

+2284
-2284
lines changed

25 files changed

+2284
-2284
lines changed

packages/thirdweb/src/analytics/track/connect.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { describe, it, expect, beforeAll, afterAll, afterEach } from "vitest";
2-
import { setupServer } from "msw/node";
31
import { http, HttpResponse } from "msw";
4-
import { trackConnect } from "./connect.js";
2+
import { setupServer } from "msw/node";
3+
import { afterAll, afterEach, beforeAll, describe, expect, it } from "vitest";
54
import type { ThirdwebClient } from "../../client/client.js";
5+
import { trackConnect } from "./connect.js";
66

77
const server = setupServer(
88
http.post("https://c.thirdweb.com/event", () => {
@@ -21,7 +21,7 @@ describe("trackConnect", () => {
2121
secretKey: undefined,
2222
};
2323

24-
let requestBody: any;
24+
let requestBody: unknown;
2525
server.use(
2626
http.post("https://c.thirdweb.com/event", async (handler) => {
2727
requestBody = await handler.request.json();
@@ -49,7 +49,7 @@ describe("trackConnect", () => {
4949
secretKey: undefined,
5050
};
5151

52-
let requestHeaders: any;
52+
let requestHeaders: Headers | undefined;
5353
server.use(
5454
http.post("https://c.thirdweb.com/event", (handler) => {
5555
requestHeaders = handler.request.headers;
@@ -67,11 +67,11 @@ describe("trackConnect", () => {
6767
walletAddress: "0x1234567890123456789012345678901234567890",
6868
});
6969

70-
expect(requestHeaders.get("x-client-id")).toEqual("test-client-id");
71-
expect(requestHeaders.get("x-ecosystem-id")).toEqual(
70+
expect(requestHeaders?.get("x-client-id")).toEqual("test-client-id");
71+
expect(requestHeaders?.get("x-ecosystem-id")).toEqual(
7272
"ecosystem.test-ecosystem-id",
7373
);
74-
expect(requestHeaders.get("x-ecosystem-partner-id")).toEqual(
74+
expect(requestHeaders?.get("x-ecosystem-partner-id")).toEqual(
7575
"test-partner-id",
7676
);
7777
});
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
import type { Ecosystem } from "../../wallets/in-app/core/wallet/types.js";
21
import type { ThirdwebClient } from "../../client/client.js";
2+
import type { Ecosystem } from "../../wallets/in-app/core/wallet/types.js";
33
import { track } from "./index.js";
44

55
/**
66
* @internal
77
*/
88
export async function trackConnect(args: {
9-
client: ThirdwebClient;
10-
ecosystem?: Ecosystem;
11-
walletType: string;
12-
walletAddress: string;
9+
client: ThirdwebClient;
10+
ecosystem?: Ecosystem;
11+
walletType: string;
12+
walletAddress: string;
1313
}) {
14-
const { client, ecosystem, walletType, walletAddress } = args;
15-
return track({
16-
client,
17-
ecosystem,
18-
data: {
19-
source: "connectWallet",
20-
action: "connect",
21-
walletType,
22-
walletAddress,
23-
},
24-
});
14+
const { client, ecosystem, walletType, walletAddress } = args;
15+
return track({
16+
client,
17+
ecosystem,
18+
data: {
19+
source: "connectWallet",
20+
action: "connect",
21+
walletType,
22+
walletAddress,
23+
},
24+
});
2525
}
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
import type { Ecosystem } from "../../wallets/in-app/core/wallet/types.js";
21
import type { ThirdwebClient } from "../../client/client.js";
32
import { getClientFetch } from "../../utils/fetch.js";
43
import { stringify } from "../../utils/json.js";
4+
import type { Ecosystem } from "../../wallets/in-app/core/wallet/types.js";
55

66
const ANALYTICS_ENDPOINT = "https://c.thirdweb.com/event";
77

88
/**
99
* @internal
1010
*/
1111
export async function track({
12-
client,
13-
ecosystem,
14-
data,
12+
client,
13+
ecosystem,
14+
data,
1515
}: {
16-
client: ThirdwebClient;
17-
ecosystem?: Ecosystem;
18-
data: object;
16+
client: ThirdwebClient;
17+
ecosystem?: Ecosystem;
18+
data: object;
1919
}) {
20-
const fetch = getClientFetch(client, ecosystem);
21-
const event = {
22-
source: "sdk",
23-
...data,
24-
};
20+
const fetch = getClientFetch(client, ecosystem);
21+
const event = {
22+
source: "sdk",
23+
...data,
24+
};
2525

26-
return fetch(ANALYTICS_ENDPOINT, {
27-
method: "POST",
28-
body: stringify(event),
29-
}).catch(() => {});
26+
return fetch(ANALYTICS_ENDPOINT, {
27+
method: "POST",
28+
body: stringify(event),
29+
}).catch(() => {});
3030
}

packages/thirdweb/src/analytics/track/pay.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { describe, it, expect, beforeAll, afterAll, afterEach } from "vitest";
2-
import { setupServer } from "msw/node";
31
import { http, HttpResponse } from "msw";
4-
import { trackPayEvent } from "./pay.js";
2+
import { setupServer } from "msw/node";
3+
import { afterAll, afterEach, beforeAll, describe, expect, it } from "vitest";
54
import type { ThirdwebClient } from "../../client/client.js";
5+
import { trackPayEvent } from "./pay.js";
66

77
const server = setupServer(
88
http.post("https://c.thirdweb.com/event", () => {
@@ -21,7 +21,7 @@ describe("trackPayEvent", () => {
2121
secretKey: undefined,
2222
};
2323

24-
let requestBody: any;
24+
let requestBody: unknown;
2525
server.use(
2626
http.post("https://c.thirdweb.com/event", async (handler) => {
2727
requestBody = await handler.request.json();
@@ -62,7 +62,7 @@ describe("trackPayEvent", () => {
6262
secretKey: undefined,
6363
};
6464

65-
let requestHeaders: any;
65+
let requestHeaders: Headers | undefined;
6666
server.use(
6767
http.post("https://c.thirdweb.com/event", (handler) => {
6868
requestHeaders = handler.request.headers;
@@ -87,11 +87,11 @@ describe("trackPayEvent", () => {
8787
dstChainId: 137,
8888
});
8989

90-
expect(requestHeaders.get("x-client-id")).toEqual("test-client-id");
91-
expect(requestHeaders.get("x-ecosystem-id")).toEqual(
90+
expect(requestHeaders?.get("x-client-id")).toEqual("test-client-id");
91+
expect(requestHeaders?.get("x-ecosystem-id")).toEqual(
9292
"ecosystem.test-ecosystem-id",
9393
);
94-
expect(requestHeaders.get("x-ecosystem-partner-id")).toEqual(
94+
expect(requestHeaders?.get("x-ecosystem-partner-id")).toEqual(
9595
"test-partner-id",
9696
);
9797
});
Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
1-
import type { Ecosystem } from "../../wallets/in-app/core/wallet/types.js";
21
import type { ThirdwebClient } from "../../client/client.js";
2+
import type { Ecosystem } from "../../wallets/in-app/core/wallet/types.js";
33
import { track } from "./index.js";
44

55
/**
66
* @internal
77
*/
88
export async function trackPayEvent(args: {
9-
client: ThirdwebClient;
10-
ecosystem?: Ecosystem;
11-
event: string;
12-
walletAddress?: string;
13-
walletType?: string;
14-
fromToken?: string;
15-
fromAmount?: string;
16-
toToken?: string;
17-
toAmount?: string;
18-
chainId?: number;
19-
dstChainId?: number;
9+
client: ThirdwebClient;
10+
ecosystem?: Ecosystem;
11+
event: string;
12+
walletAddress?: string;
13+
walletType?: string;
14+
fromToken?: string;
15+
fromAmount?: string;
16+
toToken?: string;
17+
toAmount?: string;
18+
chainId?: number;
19+
dstChainId?: number;
2020
}) {
21-
return track({
22-
client: args.client,
23-
ecosystem: args.ecosystem,
24-
data: {
25-
source: "pay",
26-
action: args.event,
27-
clientId: args.client.clientId,
28-
chainId: args.chainId,
29-
walletAddress: args.walletAddress,
30-
walletType: args.walletType,
31-
tokenAddress: args.fromToken,
32-
amountWei: args.fromAmount,
33-
dstTokenAddress: args.toToken,
34-
dstChainId: args.chainId,
35-
},
36-
});
21+
return track({
22+
client: args.client,
23+
ecosystem: args.ecosystem,
24+
data: {
25+
source: "pay",
26+
action: args.event,
27+
clientId: args.client.clientId,
28+
chainId: args.chainId,
29+
walletAddress: args.walletAddress,
30+
walletType: args.walletType,
31+
tokenAddress: args.fromToken,
32+
amountWei: args.fromAmount,
33+
dstTokenAddress: args.toToken,
34+
dstChainId: args.chainId,
35+
},
36+
});
3737
}

0 commit comments

Comments
 (0)