decentralised.art Chain Publish API (0.4.0)

Download OpenAPI specification:

License: MIT

Owner-paid on-chain publication of entities created on this server. The server prepares an unsigned registry transaction, the owner's wallet sends and pays for it (or signs it offline for the server to relay), and the server confirms the receipt. The server never holds a key for it. Enabled with --publish; otherwise every route answers 403 so a disabled server is distinguishable from a wrong URL.

publish

On-chain publication of transformations, conditions and connectors.

CORS preflight

path Parameters
kind
required
string (EntityKind)
Enum: "transformation" "condition" "connector"

Kind of entity to publish. Any other value is 404.

Responses

Prepare publication

Rebuild the entity from the definition retained when it was created, store its artifact durably, and return the unsigned registry transaction. The caller must own the entity. A connector's dependencies must already be registered with the artifacts it was built against; they are never published recursively. Deterministic reverts (name taken, stale nonce, identity mismatch) are reported here, before the owner pays.

Authorizations:
BearerAuth
path Parameters
kind
required
string (EntityKind)
Enum: "transformation" "condition" "connector"

Kind of entity to publish. Any other value is 404.

Request Body schema: application/json
required
name
required
string (EntityName) [ 1 .. 128 ] characters ^[A-Za-z_][A-Za-z0-9_]*$

Entity name. Starts with a letter or '', contains only letters, digits and '', at most 128 characters.

relay
boolean
Default: false

Also return signing, what an offline signer needs to complete the transaction for POST /publish/{kind}/send. Leave unset for a browser wallet, which chooses its own nonce and fees.

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "relay": false
}

Response samples

Content type
application/json
Example
{
  • "status": "prepared",
  • "kind": "transformation",
  • "name": "string",
  • "transaction": {
    },
  • "address": "string",
  • "content_hash": "string",
  • "publication_nonce": 0,
  • "deadline": 0,
  • "signing": {
    }
}

CORS preflight

path Parameters
kind
required
string (EntityKind)
Enum: "transformation" "condition" "connector"

Kind of entity to publish. Any other value is 404.

Responses

Relay publication

Broadcast a publication transaction the owner signed offline, through the server's own chain provider, so the owner needs no RPC endpoint. The owner still pays for it. The server forwards it only when the caller signed it, it calls the configured registry on its chain with no value, it publishes exactly the named entity with this content hash, and a dry run succeeds within its gas limit. Confirm it with POST /publish/{kind}.

Authorizations:
BearerAuth
path Parameters
kind
required
string (EntityKind)
Enum: "transformation" "condition" "connector"

Kind of entity to publish. Any other value is 404.

Request Body schema: application/json
required
name
required
string (EntityName) [ 1 .. 128 ] characters ^[A-Za-z_][A-Za-z0-9_]*$

Entity name. Starts with a letter or '', contains only letters, digits and '', at most 128 characters.

content_hash
required
string (Hash32) ^(0x)?[a-fA-F0-9]{64}$

32-byte hex value.

raw_tx
required
string^0x02[0-9a-fA-F]+$

Signed type-2 transaction: transaction merged with signing from a relay prepare, as 0x02 || rlp(...).

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "content_hash": "string",
  • "raw_tx": "string"
}

Response samples

Content type
application/json
{
  • "status": "pending",
  • "tx_hash": "string"
}

CORS preflight

path Parameters
kind
required
string (EntityKind)
Enum: "transformation" "condition" "connector"

Kind of entity to publish. Any other value is 404.

Responses

Confirm publication

Look the transaction receipt up once. Repeat the request while it answers 202; that is the status check. The registry projection of the event, not this response, is what the read endpoints serve.

Authorizations:
BearerAuth
path Parameters
kind
required
string (EntityKind)
Enum: "transformation" "condition" "connector"

Kind of entity to publish. Any other value is 404.

Request Body schema: application/json
required
name
required
string (EntityName) [ 1 .. 128 ] characters ^[A-Za-z_][A-Za-z0-9_]*$

Entity name. Starts with a letter or '', contains only letters, digits and '', at most 128 characters.

content_hash
required
string (Hash32) ^(0x)?[a-fA-F0-9]{64}$

32-byte hex value.

tx_hash
required
string

Hash of the sent publication transaction.

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "content_hash": "string",
  • "tx_hash": "string"
}

Response samples

Content type
application/json
{
  • "status": "mined",
  • "kind": "transformation",
  • "name": "string",
  • "tx_hash": "string",
  • "block_number": 0,
  • "address": "string",
  • "owner": "string",
  • "content_hash": "string"
}