Skip to main content
GET
/
platform
/
admin
/
smart_contract_implementations_deploy
/
{id}
/
deploy
/
{blockchainId}
/
preview
Get deployment preview
curl --request GET \
  --url https://api.example.com/platform/admin/smart_contract_implementations_deploy/{id}/deploy/{blockchainId}/preview
{
  "isSuccess": true,
  "isFailure": false,
  "error": null,
  "value": {
    "id": 42,
    "name": "Example"
  }
}

Description

Returns deployment preview information for a smart contract implementation on a specific blockchain network, including available owner wallet accounts and network-specific deployment requirements. This endpoint is used to prepare for contract deployment.

Input

  • id (long, required) - The unique identifier of the smart contract implementation.
  • blockchainId (long, required) - Target blockchain network identifier (1 for Ethereum, 137 for Polygon, etc.).

Output

Returns a SmartContractImplementationDeployPreviewModel containing:
  • implementation (object) - Basic implementation details.
  • blockchain (object) - Target blockchain information including name and network ID.
  • availableOwnerWallets (array) - Collection of wallet tenants that can own the deployed contract, each containing:
    • walletTenantId (long) - Unique identifier for the wallet tenant.
    • walletAddress (string) - Blockchain address of the wallet (0x…).
    • balance (string) - Current balance in native currency for gas fees.
    • name (string) - Human-readable wallet name.
  • estimatedGasCost (string) - Estimated gas cost for deployment in native currency.
  • requiresConstructorParams (bool) - Indicates if contract requires constructor parameters.

Examples

Request
GET /api/platform/smart-contract-implementations/1/deploys/preview?blockchainId=137
Authorization: Bearer {token}
Response (200 OK)
{
  "data": {
    "implementation": {
      "id": 1,
      "type": "IssuerFactoryImplementation",
      "contractClassName": "IssuerFactory"
    },
    "blockchain": {
      "id": 137,
      "name": "Polygon Mainnet",
      "networkId": 137,
      "chainId": "0x89"
    },
    "availableOwnerWallets": [
      {
        "walletTenantId": 2048,
        "walletAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
        "balance": "2.5 MATIC",
        "name": "Platform Deployer Wallet"
      },
      {
        "walletTenantId": 2049,
        "walletAddress": "0x1234567890AbcdEF1234567890aBcdef12345678",
        "balance": "5.8 MATIC",
        "name": "Secondary Deployer Wallet"
      }
    ],
    "estimatedGasCost": "0.015 MATIC",
    "requiresConstructorParams": false
  }
}

Errors

  • 400 Bad Request: Invalid implementation ID or blockchain ID format.
  • 401 Unauthorized: Missing or invalid authentication token.
  • 403 Forbidden: User lacks platform administrator privileges.
  • 404 Not Found: Smart contract implementation or blockchain not found.
  • 500 Internal Server Error: Unexpected system error occurred.

Notes

Requires platform administrator privileges. Use this endpoint before initiating deployment to select an appropriate owner wallet with sufficient balance. The estimated gas cost is approximate and may vary based on network congestion. If no wallets have sufficient balance, deployment will fail.

Path Parameters

id
integer<int64>
required

Unique identifier of the smart contract implementation.

blockchainId
integer<int64>
required

Target blockchain network identifier (e.g., 1 for Ethereum, 137 for Polygon).

Query Parameters

api-version
string | null

Response

Deployment preview retrieved successfully.

Wrapper for API operation results containing success status, error information, and return value.

isSuccess
boolean

True if the operation completed successfully, false otherwise.

Example:

true

isFailure
boolean

True if the operation failed, false otherwise.

Example:

false

error
object

Error information returned when the operation fails.

Example:
{
"code": "ValidationError",
"message": "The request parameters failed validation.",
"info": [
"The Name field is required.",
"The Id field must be greater than 0."
]
}
value
object

The result value returned when the operation is successful.