Skip to content

Commit 7bcb1be

Browse files
delete old widget code
1 parent 9c75db7 commit 7bcb1be

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+15
-7964
lines changed

packages/thirdweb/src/insight/common.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,3 @@ export async function assertInsightEnabled(chains: Chain[]) {
1414
);
1515
}
1616
}
17-
18-
export async function isInsightEnabled(chain: Chain) {
19-
const chainIds = await getInsightEnabledChainIds();
20-
return chainIds.includes(chain.id);
21-
}

packages/thirdweb/src/pay/buyWithCrypto/getStatus.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,6 @@ export type BuyWithCryptoStatus =
8484
purchaseData?: PurchaseData;
8585
};
8686

87-
export type ValidBuyWithCryptoStatus = Exclude<
88-
BuyWithCryptoStatus,
89-
{ status: "NOT_FOUND" }
90-
>;
91-
9287
/**
9388
* Gets the status of a buy with crypto transaction
9489
* @param buyWithCryptoTransaction - Object of type [`BuyWithCryptoTransaction`](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoTransaction)
Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { getAddress } from "../../utils/address.js";
2-
import type { PayTokenInfo } from "../utils/commonTypes.js";
32
import type { BuyWithFiatQuote } from "./getQuote.js";
43

54
/**
@@ -28,58 +27,3 @@ export function isSwapRequiredPostOnramp(
2827

2928
return !(sameChain && sameToken);
3029
}
31-
32-
export function getOnRampSteps(
33-
buyWithFiatQuote: BuyWithFiatQuote,
34-
): OnRampStep[] {
35-
const isSwapRequired = isSwapRequiredPostOnramp(buyWithFiatQuote);
36-
37-
if (!isSwapRequired) {
38-
return [
39-
{
40-
action: "buy",
41-
amount: buyWithFiatQuote.estimatedToAmountMin,
42-
token: buyWithFiatQuote.toToken,
43-
},
44-
];
45-
}
46-
47-
if (buyWithFiatQuote.routingToken) {
48-
return [
49-
{
50-
action: "buy",
51-
amount: buyWithFiatQuote.onRampToken.amount,
52-
token: buyWithFiatQuote.onRampToken.token,
53-
},
54-
{
55-
action: "swap",
56-
amount: buyWithFiatQuote.routingToken.amount,
57-
token: buyWithFiatQuote.routingToken.token,
58-
},
59-
{
60-
action: "bridge",
61-
amount: buyWithFiatQuote.estimatedToAmountMin,
62-
token: buyWithFiatQuote.toToken,
63-
},
64-
];
65-
}
66-
67-
return [
68-
{
69-
action: "buy",
70-
amount: buyWithFiatQuote.onRampToken.amount,
71-
token: buyWithFiatQuote.onRampToken.token,
72-
},
73-
{
74-
action: "swap",
75-
amount: buyWithFiatQuote.estimatedToAmountMin,
76-
token: buyWithFiatQuote.toToken,
77-
},
78-
];
79-
}
80-
81-
export type OnRampStep = {
82-
action: "buy" | "swap" | "bridge";
83-
token: PayTokenInfo;
84-
amount: string;
85-
};

packages/thirdweb/src/pay/utils/commonTypes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ export type PayOnChainTransactionDetails = {
1919

2020
export type FiatProvider = (typeof FiatProviders)[number];
2121

22-
export const FiatProviders = ["coinbase", "stripe", "transak"] as const;
22+
const FiatProviders = ["coinbase", "stripe", "transak"] as const;

packages/thirdweb/src/react/core/hooks/usePaymentMethods.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,14 @@ export function usePaymentMethods(options: {
145145

146146
// Add all origin tokens from this chain's routes
147147
for (const route of routesForChain) {
148+
// Skip if the origin token is the same as the destination token, will be added later only if includeDestinationToken is true
149+
if (
150+
route.originToken.chainId === destinationToken.chainId &&
151+
route.originToken.address.toLowerCase() ===
152+
destinationToken.address.toLowerCase()
153+
) {
154+
continue;
155+
}
148156
const tokenKey = `${route.originToken.chainId}-${route.originToken.address.toLowerCase()}`;
149157
allValidOriginTokens.set(tokenKey, route.originToken);
150158
}

packages/thirdweb/src/react/core/utils/storage.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import type { AsyncStorage } from "../../../utils/storage/AsyncStorage.js";
22
import type { AuthArgsType } from "../../../wallets/in-app/core/authentication/types.js";
33

44
export const LAST_AUTH_PROVIDER_STORAGE_KEY = "lastAuthProvider";
5-
export const PREFERRED_FIAT_PROVIDER_STORAGE_KEY = "preferredFiatProvider";
65

76
export async function setLastAuthProvider(
87
authProvider: AuthArgsType["strategy"],

0 commit comments

Comments
 (0)