BSV blockchainBSV blockchain

Internalize an external transaction (receive payment).

POST/actions/internalize

Corresponds to StorageProvider.internalizeAction(auth, args). Credits one or more outputs of an external transaction to the authenticated user’s wallet. Returns isMerge: true if the transaction was already known (replay guard for BRC-121).

Body application/json

txinteger[]required

Atomic BEEF bytes of the transaction to internalize.

outputsobject[]required
descriptionstringrequired

Response

Internalization result.

acceptedboolean
isMergeboolean

true if the transaction was already known to storage. Used by BRC-121 as a replay guard.

txidstring
satoshisinteger

Net satoshi change credited to the user.

sendWithResultsobject[]
notDelayedResultsobject[]
Show notDelayedResults properties
txidstring
status"success" | "doubleSpend" | "serviceError" | "invalidTx"
competingTxsstring[]
competingBeefinteger[]

Bad request — invalid arguments.

errorstring
codestring

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

Authentication required or token invalid.

errorstring
codestring

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

Internal storage error.

errorstring
codestring

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

Request
curl -X POST "https://{host}/storage/v1/actions/internalize" \
  -H "Content-Type: application/json" \
  -d '{
  "tx": [
    0
  ],
  "outputs": [
    {}
  ],
  "description": "string"
}'
Response
{
  "accepted": true,
  "isMerge": true,
  "txid": "string",
  "satoshis": 0,
  "sendWithResults": [
    {}
  ],
  "notDelayedResults": [
    {
      "txid": "string",
      "status": "success",
      "competingTxs": [
        "string"
      ],
      "competingBeef": [
        0
      ]
    }
  ]
}