Skip to content

Commit 0d4a8d3

Browse files
lint
1 parent 9253e16 commit 0d4a8d3

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

packages/thirdweb/src/x402/common.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ type GetPaymentRequirementsResult = {
3838
* @returns The payment requirements, selected payment requirements, and decoded payment
3939
*/
4040
export async function decodePaymentRequest(
41-
args: PaymentArgs,
41+
args: PaymentArgs
4242
): Promise<GetPaymentRequirementsResult | PaymentRequiredResult> {
4343
const {
4444
price,
@@ -81,7 +81,7 @@ export async function decodePaymentRequest(
8181
const atomicAmountForAsset = await processPriceToAtomicAmount(
8282
price,
8383
chainId,
84-
facilitator,
84+
facilitator
8585
);
8686
if ("error" in atomicAmountForAsset) {
8787
return {
@@ -163,7 +163,7 @@ export async function decodePaymentRequest(
163163
const selectedPaymentRequirements = paymentRequirements.find(
164164
(value) =>
165165
value.scheme === decodedPayment.scheme &&
166-
value.network === decodedPayment.network,
166+
value.network === decodedPayment.network
167167
);
168168
if (!selectedPaymentRequirements) {
169169
return {
@@ -199,7 +199,7 @@ export async function decodePaymentRequest(
199199
async function processPriceToAtomicAmount(
200200
price: Money | ERC20TokenAmount,
201201
chainId: number,
202-
facilitator: ThirdwebX402Facilitator,
202+
facilitator: ThirdwebX402Facilitator
203203
): Promise<
204204
{ maxAmountRequired: string; asset: DefaultAsset } | { error: string }
205205
> {
@@ -223,7 +223,10 @@ async function processPriceToAtomicAmount(
223223
};
224224
}
225225
asset = defaultAsset;
226-
maxAmountRequired = toUnits(parsedUsdAmount.toString(), defaultAsset.decimals).toString();
226+
maxAmountRequired = toUnits(
227+
parsedUsdAmount.toString(),
228+
defaultAsset.decimals
229+
).toString();
227230
} else {
228231
// Token amount in atomic units
229232
maxAmountRequired = price.amount;
@@ -256,11 +259,11 @@ async function processPriceToAtomicAmount(
256259

257260
async function getDefaultAsset(
258261
chainId: number,
259-
facilitator: ThirdwebX402Facilitator,
262+
facilitator: ThirdwebX402Facilitator
260263
): Promise<DefaultAsset | undefined> {
261264
const supportedAssets = await facilitator.supported();
262265
const matchingAsset = supportedAssets.kinds.find(
263-
(supported) => supported.network === `eip155:${chainId}`,
266+
(supported) => supported.network === `eip155:${chainId}`
264267
);
265268
const assetConfig = matchingAsset?.extra?.defaultAsset as DefaultAsset;
266269
return assetConfig;
@@ -284,7 +287,7 @@ export async function getSupportedSignatureType(args: {
284287
client: args.client,
285288
address: args.asset,
286289
chain: getCachedChain(args.chainId),
287-
}),
290+
})
288291
).catch((error) => {
289292
console.error("Error resolving contract ABI", error);
290293
return [] as Abi;
@@ -350,7 +353,7 @@ async function getOrDetectTokenExtras(args: {
350353
}
351354
const supportedAsset = exactScheme.extra?.supportedAssets?.find(
352355
(asset) =>
353-
asset.address.toLowerCase() === partialAsset.address.toLowerCase(),
356+
asset.address.toLowerCase() === partialAsset.address.toLowerCase()
354357
);
355358
if (!supportedAsset) {
356359
return undefined;

0 commit comments

Comments
 (0)