traits - Stacks

Reports whether a contract implements a given trait, identified by the trait's deployer, contract, and trait name.

Endpoint

httpGET /v2/traits/{deployer_address}/{contract_name}/{trait_deployer_address}/{trait_contract_name}/{trait_name}

Path Parameters

ParameterTypeDescription
deployer_addressstringThe implementing contract's deployer
contract_namestringThe implementing contract's name
trait_deployer_addressstringThe trait definition's deployer
trait_contract_namestringThe trait definition's contract
trait_namestringThe trait name

Example

bashexport STACKS_RPC=https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/

curl "${STACKS_RPC}v2/traits/SP2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKNRV9EJ7/my-contract/SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE/sip-010-trait-ft-standard/sip-010-trait"

Response

json{
    "is_implemented": true
}

Response Fields

FieldTypeDescription
is_implementedbooleanWhether the contract conforms to the trait

Use Cases

  • Standard checks: Verify a token contract implements SIP-010
  • Composability: Confirm trait conformance before a cross-contract call

Error Handling

ErrorMessageDescription
400 / Bad requestBad requestA path, query, or body parameter was invalid or the transaction was rejected
404 / Not foundNot foundThe account, contract, map entry, variable, or constant does not exist
403 / RBAC: access deniedAccess deniedThe GetBlock access token is missing or incorrect