Skip to content

Commit f34c8e5

Browse files
authored
fix: deposit allows passing days or amount (#72)
1 parent 4429e7a commit f34c8e5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/commands/payments.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ paymentsCommand
116116
privateKey: options.privateKey,
117117
rpcUrl: options.rpcUrl || process.env.RPC_URL,
118118
amount: options.amount,
119-
days: options.days != null ? Number(options.days) : 10, // always default to 10 days top-up, otherwise top-up to the specified number of days.
119+
days: options.days != null ? Number(options.days) : undefined, // Only pass days if explicitly provided
120120
})
121121
} catch (error) {
122122
console.error('Failed to perform deposit:', error instanceof Error ? error.message : error)

src/payments/deposit.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ import { checkFILBalance, checkUSDFCBalance, depositUSDFC, formatUSDFC, getPayme
1818
export interface DepositOptions {
1919
privateKey?: string
2020
rpcUrl?: string
21-
amount?: string
22-
days?: number
21+
amount?: string | undefined
22+
days?: number | undefined
2323
}
2424

2525
/**

0 commit comments

Comments
 (0)