NetworkAccountMergeResult network.account-merge-result@1

Generated at from openvibe-contracts v0.76.0 and openvibe-sdk v0.20.1.

Version
1.0.0
Owner
network
Visibility
first-party
Status
active
Compatibility
backward
Decision
ADR-029
Schema
https://openvibe.network/contracts/network/account-merge-result.v1.json

network.account-merge-result@1 (OpenVibe.Network; roadmap WS-B task 5, ADR-029): the answer of a merge, POST /api/v1/account/merge (the person, signed in to the survivor, with a fresh sign-in proof of the other account) or POST /api/admin/account-merges (staff.identity.merge, with a reason). What Network moved in its one transaction, as counts; everything else follows network.subject.merged. A retried merge of the same pair answers the first merge (replayed: true) and moves nothing again.

Fields

FieldTypeRequiredDescriptionConstraints
merge_idstringyes
  • pattern ^mrg_[0-9A-HJKMNP-TV-Z]{26}$
fromstringyes
  • pattern ^usr_[0-9A-HJKMNP-TV-Z]{26}$
intostringyes
  • pattern ^usr_[0-9A-HJKMNP-TV-Z]{26}$
merged_atstringyes
  • format date-time
split_untilstringyes
  • format date-time
movedobjectyes
  • no other fields
moved.providersintegeryesLinked sign-in providers now on the survivor.
  • minimum 0
moved.sessionsintegeryesSessions and devices moved; both sets stay valid until they expire.
  • minimum 0
moved.oauth_grantsintegeryes
  • minimum 0
moved.projectsintegeryesDeveloper projects, still owned, now by the survivor.
  • minimum 0
moved.coinsintegeryesOpenCoins added to the survivor (one ledger entry per side, reason account_merge).
  • minimum 0
moved.modulesintegeryesUser-module records changed on the survivor (its own fields win).
  • minimum 0
replayedbooleanyes

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: merged
{
  "merge_id": "mrg_01JAB2C3D4E5F6G7H8J9K0MNPS",
  "from": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR",
  "into": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "merged_at": "2026-09-27T21:00:00.000Z",
  "split_until": "2026-10-27T21:00:00.000Z",
  "moved": {
    "providers": 2,
    "sessions": 3,
    "oauth_grants": 1,
    "projects": 0,
    "coins": 150,
    "modules": 2
  },
  "replayed": false
}
Rejected: negative-coins
{
  "merge_id": "mrg_01JAB2C3D4E5F6G7H8J9K0MNPS",
  "from": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR",
  "into": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "merged_at": "2026-09-27T21:00:00.000Z",
  "split_until": "2026-10-27T21:00:00.000Z",
  "moved": {
    "providers": 2,
    "sessions": 3,
    "oauth_grants": 1,
    "projects": 0,
    "coins": -5,
    "modules": 2
  },
  "replayed": false
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('network.account-merge-result@1', value);   // { valid, errors: [{ path, message }] }