Skip to content

Commit bff08f4

Browse files
committed
fix: make sdk optional in claim from faucet
1 parent 9679033 commit bff08f4

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/dev/claimFromFaucet.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ interface TokenClaim {
1818
}
1919

2020
interface ClaimFromFaucetOptions {
21-
sdk: GearboxSDK;
21+
sdk?: GearboxSDK;
2222
publicClient: PublicClient;
2323
wallet: WalletClient;
2424
faucet: Address;
@@ -67,7 +67,10 @@ export async function claimFromFaucet(
6767
amnt = amount
6868
.map(v => {
6969
try {
70-
return sdk.tokensMeta.formatBN(v.token, v.amount, { symbol: true });
70+
return (
71+
sdk?.tokensMeta.formatBN(v.token, v.amount, { symbol: true }) ??
72+
`${v.amount} of ${v.token}`
73+
);
7174
} catch {
7275
return `${v.amount} of ${v.token}`;
7376
}

src/plugins/bots/BotsPlugin.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { peripheryCompressorAbi } from "../../abi/compressors/peripheryCompresso
99
import type { IGearboxSDKPlugin } from "../../sdk/index.js";
1010
import {
1111
AddressMap,
12-
AddressSet,
1312
AP_BYTECODE_REPOSITORY,
1413
AP_PERIPHERY_COMPRESSOR,
1514
AP_TREASURY,

0 commit comments

Comments
 (0)