Freeze Tron For Energy Or Bandwidth

Through this endpoint, customers can stake (freeze) the balance of a specific TRX address to obtain bandwidth or energy. When creating a request, the "fromAddress" is a required parameter. If a "toAddress" is not set, for such will be considered the address making the staking transaction. The account receiving the bandwidth or energy must have or previously had a TRX balance in order to be eligible to obtain the resources.. The minimum amount for staking is 1 TRX. Note: Staking duration by default is 3 days from the time of freezing, it can NOT be more or less than that. When staking the same address again the duration resets.

Supports Callback Functionality Single Result - This endpoint returns only one single result. POST /wallet-as-a-service/wallets/{walletId}/{blockchain}/{network}/addresses/{sender}/freeze

Path Parameters

  • Required
    blockchain string

    Represents the specific blockchain protocol name, e.g. Ethereum, Bitcoin, etc.

    Example : tron
    Possible Values : tron
  • Required
    network string

    Represents the name of the blockchain network used; blockchain networks are usually identical as technology and software, but they differ in data, e.g. - "mainnet" is the live network with actual data while networks like "testnet", "ropsten" are test networks.

    Example : nile
    Possible Values : mainnet nile
  • Required
    sender string

    Defines the address that sends the amount

    Example : TTKi4zqgdWJcGSYyFU5DJcoXtJQSTZMWi4
  • Required
    walletId string

    Represents the sender's specific and unique Wallet ID of the sender.

    Example : 62a84a2425a05500079dda56

Query parameters

  • Optional
    context string

    In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. context is specified by the user.

    Example : yourExampleString

Request body schema application/json

  • Optional
    context string

    In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. context is specified by the user.

    Example : yourExampleString
  • Required
    data object
    • Required
      item object
      • Optional
        additionalData string

        Represents an optional note to add a free text in, explaining or providing additional detail on the transaction request.

        Example : yourAdditionalInformationhere
      • Required
        amount string

        Defines the amount that has to be transferred

        Example : 2
      • Optional
        callbackSecretKey string

        Represents the Secret Key value provided by the customer. This field is used for security purposes during the callback notification, in order to prove the sender of the callback as Crypto APIs. For more information please see our Documentation.

        Example : yourSecretString
      • Optional
        callbackUrl string

        Represents the URL that is set by the customer where the callback will be received at. The callback notification will be received only if and when the event occurs. We support ONLY httpS type of protocol.

        Example : https://example.com
      • Optional
        recipient string

        Defines the specific recipient address for the transaction.

        Example : TTKi4zqgdWJcGSYyFU5DJcoXtJQSTZMWi4
      • Required
        resource string

        Transaction note with additional details

        Example : energy
        Possible Values : bandwidth energy

Response schema

201 400 401 402 403 409 415 422 429 500
HTTP Status Code: 201
Content-Type: application/json

Successfull Request

  • Object :

  • Required
    apiVersion string

    Specifies the version of the API that incorporates this endpoint.

    Example : 2021-03-20
  • Required
    requestId string

    Defines the ID of the request. The requestId is generated by Crypto APIs and it's unique for every request.

    Example : 601c1710034ed6d407996b30
  • Optional
    context string

    In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. context is specified by the user.

    Example : yourExampleString
  • Required
    data object
    • Required
      item object
      • Optional
        additionalData string

        Defines a transaction note with additional details

        Example : exampleAdditionalData
      • Required
        address string

        Defines the sender's public address.

        Example : TNHHth9H4BRg5V7kPSn9tipENtZz6ecNXj
      • Optional
        callbackSecretKey string

        Represents the Secret Key value provided by the customer. This field is used for security purposes during the callback notification, in order to prove the sender of the callback as Crypto APIs. For more information please see our Documentation.

        Example : yourSecretKey
      • Optional
        callbackUrl string

        Represents the URL that is set by the customer where the callback will be received at. The callback notification will be received only if and when the event occurs. We support ONLY httpS type of protocol.

        Example : yourCallbackUrl
      • Required
        destinations array

        Defines the destination of the transaction

        • Required
          address string

          Represents the address of the destination

          Example : TNHHth9H4BRg5V7kPSn9tipENtZz6ecNXj
        • Required
          amount string

          Represents the amount of the destination

          Example : 10
        • Required
          unit string

          Defines the amounts' unit

          Example : TRX
      • Required
        resource string

        Defines the resource staking for (eg. Bandwidth, Energy)

        Example : ENERGY
      • Required
        status string

        Represents the status of the transaction.

        Example : created
        Possible Values : created await-approval pending prepared signed broadcasted success failed rejected mined mined-with-errors
      • Required
        transactionId string

        Defines the created transaction

        Example : 6343eea3b4566d51f278c674
      • Required
        transactionType string

        Defines the type of the transacted units.

        Example : staking
        Possible Values : staking unstaking
      • Required
        walletId string

        Represents the sender's specific and unique Wallet ID of the sender.

        Example : 62a84a2425a05500079dda56
      • Required
        transactionAmount object
        • Required
          unit string

          Represents the amounts' unit

          Example : TRX
        • Required
          value string

          Shows the total amount of the transaction.

          Example : 10

Callback parameters Method : POST

You can use the optional parameter callbackSecretKey in your request for additional security. It is then used to create a unique hash string in the x-signature response header in the callback request itself. For more information, please see our Documentation.
TRANSACTION_REQUEST_APPROVAL TRANSACTION_REQUEST_REJECTION TRANSACTION_REQUEST_BROADCASTED TRANSACTION_REQUEST_MINED TRANSACTION_REQUEST_FAIL

Content-Type : application/json

  • Object :

  • Required
    apiVersion string

    Specifies the version of the API that incorporates this endpoint.

    Example : 2021-03-20
  • Required
    referenceId string

    Represents a unique identifier that serves as reference to the specific request which prompts a callback, e.g. Blockchain Events Subscription, Blockchain Automation, etc.

    Example : 6038d09050653d1f0e40584c
  • Required
    idempotencyKey string

    Specifies a unique ID generated by the system and attached to each callback. It is used by the server to recognize consecutive requests with the same data with the purpose not to perform the same operation twice.

    Example : e55bf7a4a7188855f1c27541a6c387d04cc3b22ee34d1304b0e6ecad61c9906c
  • Required
    data object

    Specifies all data, as attributes, included into the callback notification, which depends on the event.

    • Required
      product string

      Represents the Crypto APIs 2.0 product which sends the callback.

      Example : WALLET_AS_A_SERVICE
    • Required
      event string

      Defines the specific event, for which a callback subscription is set.

      Example : TRANSACTION_REQUEST_APPROVAL
    • Required
      item object

      Defines an item as one result.

      • Required
        blockchain string

        Represents the specific blockchain protocol name, e.g. Ethereum, Bitcoin, etc.

        Example : ethereum
      • Required
        network string

        Represents the name of the blockchain network used; blockchain networks are usually identical as technology and software, but they differ in data, e.g. - "mainnet" is the live network with actual data while networks like "testnet", "ropsten", "rinkeby" are test networks.

        Example : ropsten
      • Required
        requiredApprovals integer

        The required number of approvals needed to approve the transaction.

        Example : 2
      • Required
        requiredRejections integer

        The required number of rejections needed to reject the transaction.

        Example : 2
      • Required
        currentApprovals integer

        The current number of approvals given for the transaction.

        Example : 1
      • Required
        currentRejections integer

        The current number of rejections given for the transaction.

        Example : 0

Credits Cost : 500 Credits For 1 Result(s)

Try it out

Request Example

POST
https://rest.cryptoapis.io/wallet-as-a-service/wallets/62a84a2425a05500079dda56/tron/nile/addresses/TTKi4zqgdWJcGSYyFU5DJcoXtJQSTZMWi4/freeze?context=yourExampleString
Headers
Content-Type: application/json
X-API-Key: my-api-key

Request Body
{
    "context": "yourExampleString",
    "data": {
        "item": {
            "additionalData": "yourAdditionalInformationhere",
            "amount": "2",
            "callbackSecretKey": "yourSecretString",
            "callbackUrl": "https://example.com",
            "recipient": "TTKi4zqgdWJcGSYyFU5DJcoXtJQSTZMWi4",
            "resource": "energy"
        }
    }
}

Response Example

{
    "apiVersion": "2021-03-20",
    "requestId": "601c1710034ed6d407996b30",
    "context": "yourExampleString",
    "data": {
        "item": {
            "additionalData": "exampleAdditionalData",
            "address": "TNHHth9H4BRg5V7kPSn9tipENtZz6ecNXj",
            "callbackSecretKey": "yourSecretKey",
            "callbackUrl": "yourCallbackUrl",
            "destinations": [
                {
                    "address": "TNHHth9H4BRg5V7kPSn9tipENtZz6ecNXj",
                    "amount": "10",
                    "unit": "TRX"
                }
            ],
            "resource": "ENERGY",
            "status": "created",
            "transactionId": "6343eea3b4566d51f278c674",
            "transactionType": "staking",
            "walletId": "62a84a2425a05500079dda56",
            "transactionAmount": {
                "unit": "TRX",
                "value": "10"
            }
        }
    }
}

Callback Example

{
    "apiVersion": "2021-03-20",
    "referenceId": "6038d09050653d1f0e40584c",
    "idempotencyKey": "e55bf7a4a7188855f1c27541a6c387d04cc3b22ee34d1304b0e6ecad61c9906c",
    "data": {
        "product": "WALLET_AS_A_SERVICE",
        "event": "TRANSACTION_REQUEST_APPROVAL",
        "item": {
            "blockchain": "ethereum",
            "network": "ropsten",
            "requiredApprovals": 2,
            "requiredRejections": 2,
            "currentApprovals": 1,
            "currentRejections": 0
        }
    }
}