Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@blindpay/cli",
"type": "module",
"version": "0.6.0",
"version": "0.7.0",
"description": "Blindpay CLI - manage receivers, bank accounts, payouts, payins, and more from the terminal",
"license": "MIT",
"author": "Blindpay <alves@blindpay.com> (https://blindpay.com/)",
Expand Down
4 changes: 3 additions & 1 deletion src/commands/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -515,16 +515,18 @@ export async function createQuote(options: {
network?: string
token?: string
amount?: string
refundWalletAddress?: string
json: boolean
}) {
try {
const ctx = resolveContext()
const body = {
const body: Record<string, any> = {
bank_account_id: options.bankAccountId,
network: options.network || 'base',
token: options.token || 'USDC',
request_amount: parseAmount(options.amount, 1000, options.json),
}
if (options.refundWalletAddress !== undefined) body.refund_wallet_address = options.refundWalletAddress
const quote = await apiPost<{ id: string, sender_amount: number, receiver_amount: number, token?: string, currency?: string }>(ctx, `${instancePath(ctx)}/quotes`, body)
const token = quote.token ?? 'USDC'
const currency = (quote as any).currency ?? 'USD'
Expand Down
1 change: 1 addition & 0 deletions src/commands/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ const schemas: ResourceSchema[] = [
{ name: 'network', type: 'string', required: false, description: 'Blockchain network', default: 'base' },
{ name: 'token', type: 'string', required: false, description: 'Stablecoin token', default: 'USDC', enum: ['USDC', 'USDT', 'USDB'] },
{ name: 'amount', type: 'number', required: false, description: 'Amount in cents', default: '1000' },
{ name: 'refund_wallet_address', type: 'string', required: false, description: 'Refund Wallet Address (added by api-sync)' },
],
},
},
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ quotes
.option('--network <network>', 'Blockchain network', 'base')
.option('--token <token>', 'Token (USDC, USDT, USDB)', 'USDC')
.option('--amount <amount>', 'Amount in cents', '1000')
.option('--refund-wallet-address <value>', 'Refund Wallet Address (added by api-sync)')
.option('--json', 'Output as JSON', false)
.action(opts => createQuote(opts))

Expand Down
Loading