MetaStreme Beta

API Endpoints

Base URL

https://beta.metastreme.com/api/testnet

All requests require an api key to be present in the request header.

# Example Request Headers
Authorization: ApiKey 1N93Pif3VkxPUwThKnFokNbCfaVNTyRJgh
Content-Type: application/json

POST /data

Submit an OP_RETURN script to be processed into a transaction. A uuid is used to prevent the script from unintentionally being transacted multiple times. If a uuid is not provided in the request, one will be generated. Successful requests will return the uuid.

Example

Request

{
  "uuid": "64dc7932-0525-47a2-a325-f20c7914c44c",
  "script": "006a0d48656c6c6f2c20576f726c6421"
}

Response

{ "uuid": "64dc7932-0525-47a2-a325-f20c7914c44c" }

JavaScript Snippet

const axios = require("axios");
const bsv = require("bsv");

const metastreme = axios.create({
  baseURL: "https://beta.metastreme.com/api/testnet",
  headers: { Authorization: "ApiKey 1N93Pif3VkxPUwThKnFokNbCfaVNTyRJgh" },
});

const script = bsv.Script.buildSafeDataOut(["hello", "world"]).toHex();

metastreme
  .post("/data", { script })
  .then((response) => console.log(response.data));

POST /status

Query the status of a bulk number of requests.

Example

Request

{
  "uuids": [
    "64dc7932-0525-47a2-a325-f20c7914c44c",
    "08ade4e1-a298-4b20-84d9-3c86998ca5bf"
  ]
}

Response

[
  {
    "uuid": "64dc7932-0525-47a2-a325-f20c7914c44c",
    "created": "2020-06-29T08:09:06.140Z"
  },
  {
    "uuid": "08ade4e1-a298-4b20-84d9-3c86998ca5bf",
    "created": "2020-06-29T08:09:26.136Z",
    "txid": "29987f441bccb9aab32ca22f6e7852c7742d98a4c300a8dac07027b2367f3b03"
  }
]

GET /transaction/<txid>

Retrieve a raw transaction created by MetaStreme.

Example

Response

{
  "txid": "b1a288674ba09f735edf4345a6afb91c13eaed1551c33669a9ae10c3a08cf678",
  "raw": "0100000001b45371ce8523f2891c58904797c1b0001f2d59af8add2404322731c222a4
8d0cd50300006b48304502210092a69e836958184d7ecf93a4ce3bf212e81ae103e0b5e9d0b68008
df6256277c0220559fc476e088bd41c3b6e1084e404763a4e42e81cacb9b5a285e7172528fa27d41
2103337723e6bc91aea33ac302a8d7daa77af797d12369dc9f41af7d678c80f7f1acffffffff0200
000000000000000d006a0a6d657461737472656d65e11c0000000000001976a914550614b7706d3a
2481dace87cc3db4961073f3a588ac00000000"
}

Errors

Error responses contain a message field.

{ "message": "script is too long" }