Contract provides a way to interact with the contract program type.

Hierarchy (view full)

Constructors

Properties

account: null | Account

The account associated with the contract, if available.

functions: {
    initialize_proxy: InvokeFunction<[], void>;
    proxy_owner: InvokeFunction<[], StateOutput>;
    proxy_target: InvokeFunction<[], Option<ContractIdInput>>;
    set_proxy_owner: InvokeFunction<[new_proxy_owner: StateInput], void>;
    set_proxy_target: InvokeFunction<[new_target: ContractIdInput], void>;
}

A collection of functions available on the contract.

The unique contract identifier.

interface: Src14OwnedProxyInterface

The contract's ABI interface.

provider: Provider

The provider for interacting with the contract.

abi: {
    concreteTypes: ({
        concreteTypeId: string;
        metadataTypeId?: undefined;
        type: string;
        typeArguments?: undefined;
    } | {
        concreteTypeId: string;
        metadataTypeId: number;
        type: string;
        typeArguments?: undefined;
    } | {
        concreteTypeId: string;
        metadataTypeId: number;
        type: string;
        typeArguments: string[];
    })[];
    configurables: {
        concreteTypeId: string;
        name: string;
        offset: number;
    }[];
    encodingVersion: string;
    functions: {
        attributes: {
            arguments: string[];
            name: string;
        }[];
        inputs: {
            concreteTypeId: string;
            name: string;
        }[];
        name: string;
        output: string;
    }[];
    loggedTypes: {
        concreteTypeId: string;
        logId: string;
    }[];
    messagesTypes: never[];
    metadataTypes: ({
        components?: undefined;
        metadataTypeId: number;
        type: string;
        typeParameters?: undefined;
    } | {
        components: ({
            name: string;
            typeId: string;
        } | {
            name: string;
            typeId: number;
        })[];
        metadataTypeId: number;
        type: string;
        typeParameters?: undefined;
    } | {
        components: ({
            name: string;
            typeId: string;
        } | {
            name: string;
            typeId: number;
        })[];
        metadataTypeId: number;
        type: string;
        typeParameters: number[];
    })[];
    programType: string;
    specVersion: string;
} = abi
storageSlots: StorageSlot[] = storageSlots

Methods

  • Build a function invocation scope for the provided function fragment.

    Parameters

    Returns InvokeFunction<any[], any>

    A function that creates a FunctionInvocationScope.

  • Get the balance for a given asset ID for this contract.

    Parameters

    Returns Promise<BN>

    The balance of the contract for the specified asset.