Cardano & Hydra Wrapper API (0.1.0)

Download OpenAPI specification:

API for managing escrow transactions on Cardano using Hydra L2 scaling solution

Status

API server status operations

API server status check

Responses

Response samples

Content type
application/json
{
  • "message": "Cardano Hydra Escrow API Server",
  • "status": "running",
  • "version": "1.0.0",
  • "timestamp": "2019-08-24T14:15:22Z"
}

Setup

ESCROW environment setup operations

Setup ESCROW environment

Request Body schema: application/json
optional
object (SetupRequest)

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{
  • "message": "string",
  • "state": "Idle",
  • "apiKey": "string",
  • "apiKeyExpiration": "2019-08-24T14:15:22Z",
  • "escrowL1Address": "addr_test1qp0x6s5h3cj8k3hg3q5d3j2n7v8m9c0b5a4f7e8d9g6h5j4k3l2m1n0",
  • "balance": {
    },
  • "timestamp": "2019-08-24T14:15:22Z"
}

Escrow

ESCROW transaction management

Start ESCROW transaction

Request Body schema: application/json
required
apiKey
required
string

API Key for authentication

Responses

Request samples

Content type
application/json
{
  • "apiKey": "string"
}

Response samples

Content type
application/json
{
  • "message": "string",
  • "state": "Idle",
  • "escrowId": "string",
  • "timestamp": "2019-08-24T14:15:22Z"
}

Get ESCROW transaction status

Request Body schema: application/json
required
apiKey
required
string

API Key for authentication

Responses

Request samples

Content type
application/json
{
  • "apiKey": "string"
}

Response samples

Content type
application/json
{
  • "message": "string",
  • "state": "Idle",
  • "apiKeyExpiration": "2019-08-24T14:15:22Z",
  • "escrowL1Address": "addr_test1qp0x6s5h3cj8k3hg3q5d3j2n7v8m9c0b5a4f7e8d9g6h5j4k3l2m1n0",
  • "balance": {
    },
  • "timestamp": "2019-08-24T14:15:22Z"
}

Close ESCROW transaction and finalize L2 settlement

Request Body schema: application/json
required
apiKey
required
string

API Key for authentication

Responses

Request samples

Content type
application/json
{
  • "apiKey": "string"
}

Response samples

Content type
application/json
{
  • "message": "string",
  • "status": "closing",
  • "timestamp": "2019-08-24T14:15:22Z"
}

Abort ESCROW transaction

Request Body schema: application/json
required
apiKey
required
string

API Key for authentication

Responses

Request samples

Content type
application/json
{
  • "apiKey": "string"
}

Response samples

Content type
application/json
{
  • "message": "string",
  • "status": "aborted",
  • "timestamp": "2019-08-24T14:15:22Z"
}

Payment

L2 payment operations

Setup L2 payment between ESCROW wallets

Request Body schema: application/json
required
apiKey
required
string

API Key for authentication

amount
required
integer (Lovelace) >= 1

Amount in lovelace (1 ADA = 1,000,000 lovelace)

Responses

Request samples

Content type
application/json
{
  • "apiKey": "string",
  • "amount": 1000000
}

Response samples

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

Wallet

Wallet and balance operations

Get Bob L1 ESCROW wallet balance

Request Body schema: application/json
required
apiKey
required
string

API Key for authentication

Responses

Request samples

Content type
application/json
{
  • "apiKey": "string"
}

Response samples

Content type
application/json
{
  • "message": "string",
  • "state": "Idle",
  • "apiKeyExpiration": "2019-08-24T14:15:22Z",
  • "escrowL1Address": "addr_test1qp0x6s5h3cj8k3hg3q5d3j2n7v8m9c0b5a4f7e8d9g6h5j4k3l2m1n0",
  • "balance": {
    },
  • "timestamp": "2019-08-24T14:15:22Z"
}

Get Bob L2 ESCROW wallet balance

Request Body schema: application/json
required
apiKey
required
string

API Key for authentication

Responses

Request samples

Content type
application/json
{
  • "apiKey": "string"
}

Response samples

Content type
application/json
{
  • "message": "string",
  • "state": "Idle",
  • "apiKeyExpiration": "2019-08-24T14:15:22Z",
  • "escrowL1Address": "addr_test1qp0x6s5h3cj8k3hg3q5d3j2n7v8m9c0b5a4f7e8d9g6h5j4k3l2m1n0",
  • "balance": {
    },
  • "timestamp": "2019-08-24T14:15:22Z"
}

Withdraw from Bob L1 ESCROW wallet to specified address

Request Body schema: application/json
required
apiKey
required
string

API Key for authentication

amount
required
integer (Lovelace) >= 1

Amount in lovelace (1 ADA = 1,000,000 lovelace)

to
required
string (CardanoAddress) ^addr_test1[a-z0-9]+$

Cardano testnet address

Responses

Request samples

Content type
application/json
{
  • "apiKey": "string",
  • "amount": 1000000,
  • "to": "addr_test1qp0x6s5h3cj8k3hg3q5d3j2n7v8m9c0b5a4f7e8d9g6h5j4k3l2m1n0"
}

Response samples

Content type
application/json
{
  • "message": "string",
  • "balance": {
    }
}

Refund from Alice L1 ESCROW wallet to specified address

Request Body schema: application/json
required
apiKey
required
string

API Key for authentication

amount
required
integer (Lovelace) >= 1

Amount in lovelace (1 ADA = 1,000,000 lovelace)

to
required
string (CardanoAddress) ^addr_test1[a-z0-9]+$

Cardano testnet address

Responses

Request samples

Content type
application/json
{
  • "apiKey": "string",
  • "amount": 1000000,
  • "to": "addr_test1qp0x6s5h3cj8k3hg3q5d3j2n7v8m9c0b5a4f7e8d9g6h5j4k3l2m1n0"
}

Response samples

Content type
application/json
{
  • "message": "string",
  • "balance": {
    }
}