UNPKG

@silvana-one/nft

Version:
95 lines (94 loc) 2.58 kB
import { PublicKey, SmartContract } from "o1js"; /** * Interface representing ownable functionality for smart contracts. * * The `OwnableContract` interface extends `SmartContract` and provides methods to ensure that only the owner * can perform certain actions and to allow the transfer of ownership to a new owner. * * By implementing the Ownable interface, contracts can secure critical operations and provide a transparent * mechanism for ownership management. * * @interface */ export type OwnableContract = SmartContract & { /** * Transfers ownership of the contract to a new owner. * * @param {PublicKey} to - The public key of the new owner. * @returns {Promise<PublicKey>} A promise that resolves to the public key of the old owner. */ transferOwnership(to: PublicKey): Promise<PublicKey>; }; declare const OwnershipChangeEvent_base: (new (value: { from: PublicKey; to: PublicKey; }) => { from: PublicKey; to: PublicKey; }) & { _isStruct: true; } & Omit<import("node_modules/o1js/dist/node/lib/provable/types/provable-intf.js").Provable<{ from: PublicKey; to: PublicKey; }, { from: { x: bigint; isOdd: boolean; }; to: { x: bigint; isOdd: boolean; }; }>, "fromFields"> & { fromFields: (fields: import("node_modules/o1js/dist/node/lib/provable/field.js").Field[]) => { from: PublicKey; to: PublicKey; }; } & { fromValue: (value: { from: PublicKey | { x: import("o1js").Field | bigint; isOdd: import("o1js").Bool | boolean; }; to: PublicKey | { x: import("o1js").Field | bigint; isOdd: import("o1js").Bool | boolean; }; }) => { from: PublicKey; to: PublicKey; }; toInput: (x: { from: PublicKey; to: PublicKey; }) => { fields?: import("o1js").Field[] | undefined; packed?: [import("o1js").Field, number][] | undefined; }; toJSON: (x: { from: PublicKey; to: PublicKey; }) => { from: string; to: string; }; fromJSON: (x: { from: string; to: string; }) => { from: PublicKey; to: PublicKey; }; empty: () => { from: PublicKey; to: PublicKey; }; }; /** * Event emitted when the ownership of the contract changes. * * Contains the old owner's and new owner's public keys. */ export declare class OwnershipChangeEvent extends OwnershipChangeEvent_base { } export {};