BSV blockchainBSV blockchain

Apply a sync chunk from another storage provider.

POST/sync/process

Corresponds to WalletStorageSync.processSyncChunk(args, chunk). Merges records from a foreign storage provider into this one.

Body application/json

argsobjectrequired
Show args properties
identityKeystringrequired

Identity key of the wallet owner.

fromStorageIdentityKeystringrequired

storageIdentityKey of the storage requesting the chunk.

sincestring<date-time>
pagedobject
Show paged properties
limitinteger
offsetinteger
chunkobjectrequired

A page of storage records for sync. Contains subsets of each table type changed since the requested timestamp.

Show chunk properties
usersobject[]
Show users properties
created_atstring<date-time>required
updated_atstring<date-time>required
transactionsobject[]
Show transactions properties
created_atstring<date-time>required
updated_atstring<date-time>required
outputsobject[]
Show outputs properties
created_atstring<date-time>required
updated_atstring<date-time>required
outputBasketsobject[]
Show outputBaskets properties
created_atstring<date-time>required
updated_atstring<date-time>required
provenTxsobject[]
Show provenTxs properties
created_atstring<date-time>required
updated_atstring<date-time>required
provenTxReqsobject[]
Show provenTxReqs properties
created_atstring<date-time>required
updated_atstring<date-time>required
syncStatesobject[]
Show syncStates properties
created_atstring<date-time>required
updated_atstring<date-time>required

Response

Sync chunk processing result.

doneboolean

true if no more chunks are needed.

errorstring

Authentication required or token invalid.

errorstring
codestring

Machine-readable error code (see specs/errors.md).

Request
curl -X POST "https://{host}/storage/v1/sync/process" \
  -H "Content-Type: application/json" \
  -d '{
  "args": {
    "identityKey": "string",
    "fromStorageIdentityKey": "string",
    "since": "1970-01-01T00:00:00.000Z",
    "paged": {
      "limit": 0,
      "offset": 0
    }
  },
  "chunk": {
    "users": [
      {
        "created_at": "1970-01-01T00:00:00.000Z",
        "updated_at": "1970-01-01T00:00:00.000Z"
      }
    ],
    "transactions": [
      {
        "created_at": "1970-01-01T00:00:00.000Z",
        "updated_at": "1970-01-01T00:00:00.000Z"
      }
    ],
    "outputs": [
      {
        "created_at": "1970-01-01T00:00:00.000Z",
        "updated_at": "1970-01-01T00:00:00.000Z"
      }
    ],
    "outputBaskets": [
      {
        "created_at": "1970-01-01T00:00:00.000Z",
        "updated_at": "1970-01-01T00:00:00.000Z"
      }
    ],
    "provenTxs": [
      {
        "created_at": "1970-01-01T00:00:00.000Z",
        "updated_at": "1970-01-01T00:00:00.000Z"
      }
    ],
    "provenTxReqs": [
      {
        "created_at": "1970-01-01T00:00:00.000Z",
        "updated_at": "1970-01-01T00:00:00.000Z"
      }
    ],
    "syncStates": [
      {
        "created_at": "1970-01-01T00:00:00.000Z",
        "updated_at": "1970-01-01T00:00:00.000Z"
      }
    ]
  }
}'
Response
{
  "done": true,
  "error": "string"
}