Operations

Use the blockchain as your trusted database.

Saves data to selected blockchain network

POST https://api.bws.ninja/v1/call

Use this operation to save data you can change to the blockchain.

Request Body

NameTypeDescription

solution*

string

BWS.Blockchain.Hash

version*

number

1

network*

string

check networks

operation*

string

insertString

parameters*

JSON

{
    "statusCode": 200,
    "statusMessage": "",
    "info": {
        "jobId": "59d0f46b-0b58-4972-8aca-51d06f69f25e"
    }
}

Method Parameters

ParameterTypeMax. SizeDesciption

key

string

32 characters

The hash key to link data to (you can use that key to retrieve the data using selectString).

value

string

(check network)

The value to save to the selected blockchain (the size limit is defined by the blockchain network capability).

Curl Example

This operation is asynchronous. Once executed, check the results using fetch API and the providedjobId.

curl --location 'https://api.bws.ninja/v1/call' \
--header 'X-Api-Key: API-KEY' \
--header 'Content-Type: application/json' \
--data '{
    "solution": "BWS.Blockchain.Hash",
    "version": 1,
    "network": "sepolia",
    "operation": "insertString",
    "parameters": {
        "key": "1689256807966",
        "value": "Hello!"
    }
}'

Retrieve previously saved data using insertString operation.

POST https://api.bws.ninja/v1/call

Use this operation to retrieve data previously saved using insertString.

Request Body

NameTypeDescription

solution*

string

BWS.Blockchain.Hash

version*

number

1

network*

string

check networks

operation*

string

selectString

parameters*

JSON

{
    "statusCode": 200,
    "statusMessage": "",
    "info": {
        "jobId": "59d0f46b-0b58-4972-8aca-51d06f69f25e"
    }
}

Method Parameters

ParameterTypeMax. SizeDesciption

key

string

32 characters

The hash key you previously used to save data using insertString.

Curl Example

This operation is asynchronous. Once executed, check the results using fetch API and the providedjobId.

curl --location 'https://api.bws.ninja/v1/call' \
--header 'X-Api-Key: API-KEY' \
--header 'Content-Type: application/json' \
--data '{
    "contract": "Ethereum.Database.Mutable",
    "version": 1,
    "network": "sepolia",
    "operation": "selectString",
    "parameters": {
        "key": "1689256807966"
    }
}'

Saves up to 32 characters in selected blockchain network.

POST https://api.bws.ninja/v1/call

Use this operation to save data you can change to the blockchain.

Request Body

NameTypeDescription

solution*

string

BWS.Blockchain.Hash

version*

number

1

network*

string

check networks

operation*

string

insertBytes32

parameters*

JSON

{
    "statusCode": 200,
    "statusMessage": "",
    "info": {
        "jobId": "59d0f46b-0b58-4972-8aca-51d06f69f25e"
    }
}

Method Parameters

ParameterTypeMax. SizeDesciption

key

string

32 characters

The hash key to link data to (you can use that key to retrieve the data using selectBytes32).

value

string

32 characters

The value to save to the selected blockchain. Up to 32 bytes long.

Curl Example

This operation is asynchronous. Once executed, check the results using fetch API and the providedjobId.

curl --location 'https://api.bws.ninja/v1/call' \
--header 'X-Api-Key: API-KEY' \
--header 'Content-Type: application/json' \
--data '{
    "solution": "BWS.Blockchain.Hash",
    "version": 1,
    "network": "sepolia",
    "operation": "insertBytes32",
    "parameters": {
        "key": "1689256807966",
        "value": "Hello!"
    }
}'

Retrieve previously saved data using insertBytes32 operation.

POST https://api.bws.ninja/v1/call

Use this operation to retrieve data previously saved using insertBytes32.

Request Body

NameTypeDescription

solution*

string

BWS.Blockchain.Hash

version*

number

1

network*

string

check networks

operation*

string

selectBytes32

parameters*

JSON

{
    "statusCode": 200,
    "statusMessage": "",
    "info": {
        "jobId": "59d0f46b-0b58-4972-8aca-51d06f69f25e"
    }
}

Method Parameters

ParameterTypeMax. SizeDesciption

key

string

32 characters

The hash key you previously used to save data using insertBytes32.

Curl Example

This operation is asynchronous. Once executed, check the results using fetch API and the providedjobId.

curl --location 'https://api.bws.ninja/v1/call' \
--header 'X-Api-Key: API-KEY' \
--header 'Content-Type: application/json' \
--data '{
    "solution": "BWS.Blockchain.Hash",
    "version": 1,
    "network": "sepolia",
    "operation": "selectBytes32",
    "parameters": {
        "key": "1689256807966"
    }
}'

Last updated