BSV blockchainBSV blockchain

Create a new wallet action (unsigned transaction).

POST/actions

Corresponds to StorageProvider.createAction(auth, args). Allocates inputs and outputs for a new transaction; returns the data the SDK needs to construct and sign the raw transaction.

Body application/json

argsobjectrequired

BRC-100 ValidCreateActionArgs (see brc-100-wallet.json for full schema).

Response

Action creation result.

inputBeefinteger[]
inputsobject[]
Show inputs properties
vininteger
sourceTxidstring
sourceVoutinteger
sourceSatoshisinteger
sourceLockingScriptstring

Hex-encoded locking script.

sourceTransactioninteger[]
unlockingScriptLengthinteger
providedBy"you" | "storage" | "you-and-storage"
typestring
spendingDescriptionstring
derivationPrefixstring
derivationSuffixstring
senderIdentityKeystring
outputsobject[]
Show outputs properties
voutinteger
providedBy"you" | "storage" | "you-and-storage"
purposestring
derivationSuffixstring
satoshisinteger
lockingScriptstring
noSendChangeOutputVoutsinteger[]
derivationPrefixstring
versioninteger
lockTimeinteger
referencestring

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" \
  -H "Content-Type: application/json" \
  -d '{
  "args": {}
}'
Response
{
  "inputBeef": [
    0
  ],
  "inputs": [
    {
      "vin": 0,
      "sourceTxid": "string",
      "sourceVout": 0,
      "sourceSatoshis": 0,
      "sourceLockingScript": "string",
      "sourceTransaction": [
        0
      ],
      "unlockingScriptLength": 0,
      "providedBy": "you",
      "type": "string",
      "spendingDescription": "string",
      "derivationPrefix": "string",
      "derivationSuffix": "string",
      "senderIdentityKey": "string"
    }
  ],
  "outputs": [
    {
      "vout": 0,
      "providedBy": "you",
      "purpose": "string",
      "derivationSuffix": "string",
      "satoshis": 0,
      "lockingScript": "string"
    }
  ],
  "noSendChangeOutputVouts": [
    0
  ],
  "derivationPrefix": "string",
  "version": 0,
  "lockTime": 0,
  "reference": "string"
}