All pages
Powered by GitBook
1 of 3

Loading...

Loading...

Loading...

Contract entry point

The ContractEntryPoint entity offers a normalized representation of the Casper Network EntryPoint. Entry points are associated with the Contract entity and describe how to interact with it. In CSPR.Cloud, only the name of the entry point and its relations to the Contract and ContractPackage are stored.

Properties

The ContractEntryPoint entity has the following properties:

Property
Type
Description

Example

Optional properties

None

Relations

The ContractEntryPoint entity has the following relations with other entities:

Entity
Mapping property
Description

Endpoints

The ContractEntryPoint entity has the following endpoints:

Relation endpoints

contract_hash

string(64)

Contract hash represented as a hexadecimal string. Unique contract identifier

contract_package_hash

string(64)

Hash of the contract package, this contract version is a part of, represented as a hexadecimal string

name

string

Name of the entry point

Contract

contract_hash

Entry point is associated with a contract

ContractPackage

contract_package_hash

Entry point is associated with a contract, that is a version of the contract package.

Get contract entry points
Get contract entry point costs
{
    "contract_hash": "a0a1d2d3d4d5d6d7d8d9e0e1e2e3e4e5e6e7e8e9f0f1f2f3f4f5f6f7f8f9a0a1",
    "contract_package_hash": "b0b1b2b3b4b5b6b7b8b9c0c1c2c3c4c5c6c7c8c9d0d1d2d3d4d5d6d7d8d9e0e1",
    "name": "transfer"
}

Get contract entry points

Get contract entry points by contract hash

GET /contracts/{contract_hash}/entry-points

Query params

None

Sorting

None

Optional properties

None

Response

Example

curl -X 'GET' \
  'https://api.testnet.cspr.cloud/contracts/93d923e336b20a4c4ca14d592b60e5bd3fe330775618290104f9beb326db7ae2/entry-points' \
  -H 'accept: application/json' \
  -H 'authorization: 55f79117-fc4d-4d60-9956-65423f39a06a'
PaginatedResponse
<ContractEntryPoint>
{
  "data": [
    {
      "id": 11,
      "contract_hash": "93d923e336b20a4c4ca14d592b60e5bd3fe330775618290104f9beb326db7ae2",
      "contract_package_hash": "e375d42c29c0e4b2baefa63cf2d70af34439eda851e08129d8515515d63bd6a9",
      "name": "activate_bid",
      "action_type_id": null
    },
    {
      "id": 12,
      "contract_hash": "93d923e336b20a4c4ca14d592b60e5bd3fe330775618290104f9beb326db7ae2",
      "contract_package_hash": "e375d42c29c0e4b2baefa63cf2d70af34439eda851e08129d8515515d63bd6a9",
      "name": "add_bid",
      "action_type_id": null
    },
    ...
    {
      "id": 19,
      "contract_hash": "93d923e336b20a4c4ca14d592b60e5bd3fe330775618290104f9beb326db7ae2",
      "contract_package_hash": "e375d42c29c0e4b2baefa63cf2d70af34439eda851e08129d8515515d63bd6a9",
      "name": "undelegate",
      "action_type_id": null
    }
  ],
  "item_count": 11,
  "page_count": 2
}

Get contract entry point costs

Get deploys costs and payment amounts, aggregated by contract hash and entry point name

GET /contracts/{contract_hash}/entry-points/{entry_point_name}/costs

Query params

None

Sorting

None

Optional properties

None

Response

Example

{
  "data": {
    "deploys_num": number,
    "since": datetime,
    "avg_cost": number,
    "min_cost": number,
    "max_cost": number,
    "avg_payment_amount": number,
    "min_payment_amount": number,
    "max_payment_amount": number
  }
}
curl -X 'GET' \
  'https://api.testnet.cspr.cloud/contracts/93d923e336b20a4c4ca14d592b60e5bd3fe330775618290104f9beb326db7ae2/entry-points/activate_bid/costs' \
  -H 'accept: application/json' \
  -H 'authorization: 55f79117-fc4d-4d60-9956-65423f39a06a'
{
  "data": {
    "deploys_num": 100,
    "since": "2023-10-12T07:21:07Z",
    "avg_cost": 25009900,
    "min_cost": 10000,
    "max_cost": 2500000000,
    "avg_payment_amount": 19550007300,
    "min_payment_amount": 10000,
    "max_payment_amount": 950000000000
  }
}