Interface ContractABI

    Application Binary Interface (ABI) definition for a smart contract

    The ABI describes the contract's interface, including all callable methods, their parameters, return types, and custom type definitions. This is essential for encoding function calls and decoding responses when interacting with deployed contracts.

    const contractABI: ContractABI = {
    name: "TokenContract",
    constructor: {
    name: "init",
    inputs: [
    { name: "initial_supply", type: "BigUint" }
    ],
    outputs: []
    },
    endpoints: [
    {
    name: "transfer",
    mutability: "mutable",
    inputs: [
    { name: "to", type: "Address" },
    { name: "amount", type: "BigUint" }
    ],
    outputs: [],
    payable: false
    },
    {
    name: "getBalance",
    mutability: "readonly",
    inputs: [{ name: "address", type: "Address" }],
    outputs: [{ type: "BigUint" }]
    }
    ],
    types: {}
    }
    interface ContractABI {
        buildInfo?: BuildInfo;
        constructor: ABIEndpoint;
        endpoints: ABIEndpoint[];
        kdaAttributes?: unknown[];
        name: string;
        types: Record<string, ABITypeDefinition>;
        upgradeConstructor?: ABIEndpoint;
    }

    Properties

    buildInfo?: BuildInfo

    Optional build information about the contract

    constructor: ABIEndpoint

    Constructor endpoint for contract initialization

    endpoints: ABIEndpoint[]

    Array of all callable endpoints/functions in the contract

    kdaAttributes?: unknown[]

    KDA (Klever Digital Asset) specific attributes

    name: string

    Name of the contract

    types: Record<string, ABITypeDefinition>

    Custom type definitions used in the contract

    upgradeConstructor?: ABIEndpoint

    Optional upgrade constructor for contract upgrades