import { CISContract, ContractDryRun, ContractTransactionMetadata, ContractUpdateTransactionWithSchema, CreateContractTransactionMetadata } from '../GenericContract.js'; import { ConcordiumGRPCClient } from '../grpc/GRPCClient.js'; import { AccountSigner } from '../signHelpers.js'; import { InvokeContractResult } from '../types.js'; import * as AccountAddress from '../types/AccountAddress.js'; import * as BlockHash from '../types/BlockHash.js'; import * as ContractAddress from '../types/ContractAddress.js'; import * as ContractName from '../types/ContractName.js'; import * as EntrypointName from '../types/EntrypointName.js'; import * as TransactionHash from '../types/TransactionHash.js'; import { CIS3 } from './util.js'; type View = 'supportsPermit'; type Update = 'permit'; /** * Contains methods for performing dry-run invocations of update instructions on CIS3 smart contracts. */ declare class CIS3DryRun extends ContractDryRun { /** * Performs a dry-run invocation of the `permit` entrypoint. * * @param {AccountAddress.Type | ContractAddress.Type} sender - The address of the sender of the transaction. * @param {CIS3.PermitParam} params - The parameters for the `permit` entrypoint. * @param {BlockHash.Type} blockHash - The hash of the block to perform the invocation of. Defaults to the latest finalized block on chain. * * @returns {InvokeContractResult} The contract invocation result, which includes whether or not the invocation succeeded along with the energy spent. */ permit(sender: AccountAddress.Type | ContractAddress.Type, params: CIS3.PermitParam, blockHash?: BlockHash.Type): Promise; } /** * Defines methods for interacting with CIS3 contracts. */ export declare class CIS3Contract extends CISContract { /** * Parameter schema for the `permit` CIS3 entrypoint. */ schema: Record; /** * Creates a new `CIS3Contract` instance by querying the node for the necessary information through the supplied `grpcClient`. * * @param {ConcordiumGRPCClient} grpcClient - The client used for contract invocations and updates. * @param {ContractAddress} contractAddress - Address of the contract instance. * * @throws If `InstanceInfo` could not be received for the contract, * or if the contract name could not be parsed from the information received from the node. */ static create(grpcClient: ConcordiumGRPCClient, contractAddress: ContractAddress.Type): Promise; protected makeDryRunInstance(grpcClient: ConcordiumGRPCClient, contractAddress: ContractAddress.Type, contractName: ContractName.Type): CIS3DryRun; /** * Creates a CIS3 `permit` update transaction. * This is a CIS3 sponsored transaction that allows a sponsor to send a transaction on behalf of a sponsoree. * * @param {CreateContractTransactionMetadata} metadata - Metadata needed for the transaction creation. * @param {CIS3.PermitParam} params - The parameters for the `permit` entrypoint. * Includes the signature of the sponsoree, the address of the sponsoree, and the signed message. * * @returns {ContractUpdateTransactionWithSchema} Transaction data for a `CIS3.permit` update. */ createPermit(metadata: CreateContractTransactionMetadata, params: CIS3.PermitParam): ContractUpdateTransactionWithSchema; /** * Sends a `permit` update transaction to the network. * This is a CIS3 sponsored transaction that allows a sponsor to send a transaction on behalf of a sponsoree. * * @param {ContractTransactionMetadata} metadata - Metadata needed for the transaction creation. * @param {CIS3.PermitParam} params - The parameters for the `permit` entrypoint. * Includes the signature of the sponsoree, the address of the sponsoree, and the signed message. * @param {AccountSigner} signer - The signer (of the sponsor) to use for the transaction. * * @returns {Promise} The hash of the transaction. */ permit(metadata: ContractTransactionMetadata, params: CIS3.PermitParam, signer: AccountSigner): Promise; /** * Queries the contract to determine if the `permit` function supports a given entrypoint. * * @param {EntrypointName.Type} entrypoint - The entrypoint to check for support. * @param {BlockHash.Type} [blockHash] - The hash of the block to perform the invocation of. Defaults to the latest finalized block on chain. * * @returns {Promise} Whether the contract supports the entrypoint. */ supportsPermit(entrypoint: EntrypointName.Type, blockHash?: BlockHash.Type): Promise; /** * Queries the contract with a list of entrypoints to determine if the `permit` function * supports the given entrypoints. Returns an array of booleans indicating support for each entrypoint. * * @param {EntrypointName.Type[]} entrypoints - The entrypoint to check for support. * @param {BlockHash.Type} [blockHash] - The hash of the block to perform the invocation of. Defaults to the latest finalized block on chain. * * @returns {Promise} An array of booleans indicating support for each given entrypoint. */ supportsPermit(entrypoints: EntrypointName.Type[], blockHash?: BlockHash.Type): Promise; } export {};