BSV blockchainBSV blockchain

Export a chunk of storage records for sync.

POST/sync/chunk

Corresponds to WalletStorageSync.getSyncChunk(args). Returns a paged subset of records since a given timestamp, for use by the sync protocol between storage providers.

Body application/json

identityKeystringrequired

Identity key of the wallet owner.

fromStorageIdentityKeystringrequired

storageIdentityKey of the storage requesting the chunk.

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

Response

Sync chunk.

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

Authentication required or token invalid.

errorstring
codestring

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

Request
curl -X POST "https://{host}/storage/v1/sync/chunk" \
  -H "Content-Type: application/json" \
  -d '{
  "identityKey": "string",
  "fromStorageIdentityKey": "string",
  "since": "1970-01-01T00:00:00.000Z",
  "paged": {
    "limit": 0,
    "offset": 0
  }
}'
Response
{
  "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"
    }
  ]
}