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

Name
Type
Description

solution*

string

BWS.Blockchain.Hash

version*

number

1

network*

string

operation*

string

insertString

parameters*

JSON

Method Parameters

Parameter
Type
Max. Size
Desciption

key

string

32 characters

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

Name
Type
Description

solution*

string

BWS.Blockchain.Hash

version*

number

1

network*

string

operation*

string

selectString

parameters*

JSON

Method Parameters

Parameter
Type
Max. Size
Desciption

key

string

32 characters

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

Name
Type
Description

solution*

string

BWS.Blockchain.Hash

version*

number

1

network*

string

operation*

string

insertBytes32

parameters*

JSON

Method Parameters

Parameter
Type
Max. Size
Desciption

key

string

32 characters

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

Name
Type
Description

solution*

string

BWS.Blockchain.Hash

version*

number

1

network*

string

operation*

string

selectBytes32

parameters*

JSON

Method Parameters

Parameter
Type
Max. Size
Desciption

key

string

32 characters

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