BillingWallet billing.wallet@1
Generated at from
openvibe-contracts v0.419.0 and
openvibe-sdk v0.161.0.
- Version
- 1.0.0
- Owner
- billing
- Visibility
- public
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/billing/wallet.v1.json
Universal wallet: billing.wallet. Personal bearer reads and purchases; server-side reviewed prices.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
subject | object | yes |
| |
subject.type | const | yes |
| |
subject.id | string | yes |
| |
currency | const | yes |
| |
money_writes_frozen | boolean | yes | ||
used_ai_this_month | boolean | yes | ||
balances | object | yes |
| |
balances.coins | object | yes |
| |
balances.coins.label | string | yes | ||
balances.coins.amount | string | yes |
| |
balances.coins.currency | enum | yes |
| |
balances.coins.scale | enum | yes |
| |
balances.coins.purpose | string | yes | ||
balances.coins.action | string | yes | ||
balances.coins.held | string |
| ||
balances.vibes | object | yes |
| |
balances.vibes.label | string | yes | ||
balances.vibes.amount | string | yes |
| |
balances.vibes.currency | enum | yes |
| |
balances.vibes.scale | enum | yes |
| |
balances.vibes.purpose | string | yes | ||
balances.vibes.action | string | yes | ||
balances.vibes.held | string |
| ||
balances.balance | object | yes |
| |
balances.balance.label | string | yes | ||
balances.balance.amount | string | yes |
| |
balances.balance.currency | enum | yes |
| |
balances.balance.scale | enum | yes |
| |
balances.balance.purpose | string | yes | ||
balances.balance.action | string | yes | ||
balances.balance.held | string |
| ||
bits_per_usd | number | yes | ||
recent_activity | array of object | yes |
| |
recent_activity[].id | string | yes | ||
recent_activity[].at | string | yes |
| |
recent_activity[].kind | enum | yes |
| |
recent_activity[].amount | string | yes |
| |
recent_activity[].label | string | yes | ||
recent_activity[].detail | string | yes | ||
recent_activity[].site | string | yes | ||
checkout | object | yes |
| |
checkout.providers | array of object | yes | The checkout providers on offer, each with the hosts its hosted checkout may use. The wallet follows a checkout_url only to one of these hosts or to Billing itself. |
|
checkout.providers[].name | string | yes |
| |
checkout.providers[].hosts | array of string | yes |
| |
checkout.vibes | object | yes |
| |
checkout.vibes.minimum | integer | yes |
| |
checkout.vibes.maximum | integer | yes |
| |
checkout.vibes.price_tiers | array of object | yes |
| |
checkout.vibes.price_tiers[].min | integer | yes |
| |
checkout.vibes.price_tiers[].usd_per_bit | number | yes | ||
checkout.topup | object | yes |
| |
checkout.topup.enabled | boolean | yes | ||
checkout.topup.amounts_cents | array of integer | yes |
| |
checkout.topup.fee_bps | integer | null | yes |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: example
{
"subject": {
"type": "user",
"id": "usr_00000000000000000000000001"
},
"currency": "USD",
"money_writes_frozen": false,
"used_ai_this_month": true,
"balances": {
"coins": {
"label": "OpenCoins",
"amount": "0",
"currency": "opencoins",
"scale": 0,
"purpose": "Earned by taking part",
"action": "How to earn OpenCoins"
},
"vibes": {
"label": "Vibes",
"amount": "0",
"currency": "vibes-bits",
"scale": 0,
"purpose": "Support creators and buy items",
"action": "Buy Vibes"
},
"balance": {
"label": "Balance",
"amount": "0",
"currency": "USD",
"scale": 9,
"purpose": "AI and paid features",
"action": "Top up"
}
},
"bits_per_usd": 100,
"recent_activity": [],
"checkout": {
"providers": [
{
"name": "stripe",
"hosts": [
"checkout.stripe.com"
]
}
],
"vibes": {
"minimum": 100,
"maximum": 100000,
"price_tiers": [
{
"min": 100,
"usd_per_bit": 0.012
}
]
},
"topup": {
"enabled": true,
"amounts_cents": [
1000
],
"fee_bps": 0
}
}
}Rejected: invalid-value
{
"subject": {
"type": "user",
"id": "usr_00000000000000000000000001"
},
"currency": "USD",
"money_writes_frozen": false,
"used_ai_this_month": true,
"balances": {},
"bits_per_usd": 100,
"recent_activity": [],
"checkout": {
"providers": [
"stripe"
],
"vibes": {
"minimum": 100,
"maximum": 100000,
"price_tiers": [
{
"min": 100,
"usd_per_bit": 0.012
}
]
},
"topup": {
"enabled": true,
"amounts_cents": [
1000
],
"fee_bps": 0
}
}
}Rejected: missing
{}Validate
const contracts = require('openvibe-contracts');
contracts.validate('billing.wallet@1', value); // { valid, errors: [{ path, message }] }