client.wallet.credit
Credit (adjust) a workspace wallet
Signature
class Client {
wallet: {
credit(workspaceId: string, input: CreditInput): Promise<{
transactionId: string
balanceCents: number
}>
}
}
Parameters
| Name | Type | Required | Notes |
|---|---|---|---|
| workspaceId | | Yes | Workspace ID |
| input | | Yes | Credit details (amountCents, reason?, metadata?) |
Throws
— workspace not foundNotFoundError
Examples
import { Client } from '@blueforge/client'
const bf = new Client({ apiKey: process.env.BF_API_KEY!, url: 'https://your-project.blueforge.dev' })
const { transactionId, balanceCents } = await bf.wallet.credit('ws_abc', { amountCents: 1000, reason: 'Promo credit' })
Pitfalls
- Admin only — requires elevated credentials
See also
client.wallet.debitclient.wallet.getBalance
Tested against
- Unit:
packages/client/src/__tests__/wallet.test.ts