import { SchemaVersion, SmartContractTypeValues } from './types.js'; import * as ContractName from './types/ContractName.js'; import * as EntrypointName from './types/EntrypointName.js'; import * as Parameter from './types/Parameter.js'; /** * @param moduleSchema buffer for the schema of a module that contains the contract * @param contractName name of the contract that the init contract transaction will initialize * @param schemaVersion the version of the schema provided * @returns buffer containing the schema for of init contract parameters */ export declare function getInitContractParameterSchema(moduleSchema: ArrayBuffer, contractName: ContractName.Type, schemaVersion?: SchemaVersion): Uint8Array; /** * @param moduleSchema buffer for the schema of a module that contains the contract * @param contractName name of the contract that the update contract transaction will update * @param receiveFunctionName name of function that the update contract transaction will invoke * @param schemaVersion the version of the schema provided * @returns buffer containing the schema for of update contract parameters */ export declare function getUpdateContractParameterSchema(moduleSchema: ArrayBuffer, contractName: ContractName.Type, receiveFunctionName: EntrypointName.Type, schemaVersion?: SchemaVersion): Uint8Array; /** * @param rawSchema the schema for the type * @returns JSON template of the schema */ export declare function displayTypeSchemaTemplate(rawSchema: ArrayBuffer): string; /** * @param contractName name of the contract that the init contract transaction will initialize * @param parameters the parameters to be serialized. Should correspond to the JSON representation. * @param rawSchema buffer for the schema of a module that contains the contract * @param schemaVersion the version of the schema provided * @param verboseErrorMessage Whether errors are in a verbose format or not. Defaults to `false`. * @returns serialized buffer of init contract parameters */ export declare function serializeInitContractParameters(contractName: ContractName.Type, parameters: any, rawSchema: ArrayBuffer, schemaVersion?: SchemaVersion, verboseErrorMessage?: boolean): Parameter.Type; /** * @param contractName name of the contract that the update contract transaction will update * @param receiveFunctionName name of function that the update contract transaction will invoke * @param parameters the parameters to be serialized. Should correspond to the JSON representation. * @param rawSchema buffer for the schema of a module that contains the contract * @param schemaVersion the version of the schema provided * @param verboseErrorMessage Whether errors are in a verbose format or not. Defaults to `false`. * @returns serialized buffer of update contract parameters */ export declare function serializeUpdateContractParameters(contractName: ContractName.Type, receiveFunctionName: EntrypointName.Type, parameters: any, rawSchema: ArrayBuffer, schemaVersion?: SchemaVersion, verboseErrorMessage?: boolean): Parameter.Type; /** * Given a value for a smart contract type, and the raw schema for that type, serialize the value into binary format. * @param value the value that should be serialized. Should correspond to the JSON representation * @param rawSchema the schema for the type that the given value should be serialized as * @param verboseErrorMessage Whether errors are in a verbose format or not. Defaults to `false`. * @returns serialized buffer of the value */ export declare function serializeTypeValue(value: any, rawSchema: ArrayBuffer, verboseErrorMessage?: boolean): Parameter.Type; /** * Given a contract's raw state, its name and its schema, return the state as a JSON object. * The return type is any, and the actual type should be determined by using the schema. */ export declare function deserializeContractState(contractName: ContractName.Type, schema: ArrayBuffer, state: ArrayBuffer, verboseErrorMessage?: boolean): any; /** * Deserializes a receive functions's return value from a sequence of bytes into a json object. * @param returnValueBytes A buffer containing the return value as raw bytes. * @param moduleSchema The raw module schema as a buffer. * @param contractName The name of the contract where the receive function is located. * @param functionName The name of the receive function which return value you want to deserialize. * @param schemaVersion The schema version as a number. This parameter is optional, if you provide a serialized versioned schema this argument won't be needed. * @param verboseErrorMessage Whether errors are in a verbose format or not. Defaults to `false`. */ export declare function deserializeReceiveReturnValue(returnValueBytes: ArrayBuffer, moduleSchema: ArrayBuffer, contractName: ContractName.Type, functionName: EntrypointName.Type, schemaVersion?: number, verboseErrorMessage?: boolean): any; /** * Deserializes a receive function's error from a sequence of bytes into a json object. * @param errorBytes A buffer containing the error as raw bytes. * @param moduleSchema The raw module schema as a buffer. * @param contractName The name of the contract where the receive function is located. * @param functionName The name of the receive function which error you want to deserialize. * @param verboseErrorMessage Whether errors are in a verbose format or not. Defaults to `false`. */ export declare function deserializeReceiveError(errorBytes: ArrayBuffer, moduleSchema: ArrayBuffer, contractName: ContractName.Type, functionName: EntrypointName.Type, verboseErrorMessage?: boolean): any; /** * Deserializes an init function's error from a sequence of bytes into a json object. * @param errorBytes A buffer containing the error as raw bytes. * @param moduleSchema The raw module schema as a buffer. * @param contractName The name of the init function which error you want to deserialize. * @param verboseErrorMessage Whether errors are in a verbose format or not. Defaults to `false`. */ export declare function deserializeInitError(errorBytes: ArrayBuffer, moduleSchema: ArrayBuffer, contractName: ContractName.Type, verboseErrorMessage?: boolean): any; /** * Given a binary value for a smart contract type, and the raw schema for that type, deserialize the value into the JSON representation. * @param value the value that should be deserialized. * @param rawSchema the schema for the type that the given value should be deserialized as * @param verboseErrorMessage Whether errors are in a verbose format or not. Defaults to `false`. * @returns the deserialized value */ export declare function deserializeTypeValue(value: ArrayBuffer, rawSchema: ArrayBuffer, verboseErrorMessage?: boolean): SmartContractTypeValues;