import { BigMapKeyType, MichelsonMap, MichelsonMapKey, Schema } from '@taquito/michelson-encoder'; import { OperationBatch } from '../batch/rpc-batch-provider'; import { Context } from '../context'; import { DelegateOperation } from '../operations/delegate-operation'; import { OriginationOperation } from '../operations/origination-operation'; import { RegisterGlobalConstantOperation } from '../operations/register-global-constant-operation'; import { RevealOperation } from '../operations/reveal-operation'; import { TransactionOperation } from '../operations/transaction-operation'; import { DelegateParams, OriginateParams, ParamsWithKind, RegisterDelegateParams, RegisterGlobalConstantParams, RevealParams, TransferParams, TransferTicketParams, IncreasePaidStorageParams, DrainDelegateParams, BallotParams, ProposalsParams, UpdateConsensusKeyParams, UpdateCompanionKeyParams, SmartRollupAddMessagesParams, SmartRollupOriginateParams, SmartRollupExecuteOutboxMessageParams, FailingNoopParams, StakeParams, UnstakeParams, FinalizeUnstakeParams } from '../operations/types'; import { DefaultContractType, ContractStorageType, ContractAbstraction } from './contract'; import { ContractProvider, ContractSchema, StorageProvider } from './interface'; import { EstimationProvider } from '../estimate/estimate-provider-interface'; import { TransferTicketOperation } from '../operations/transfer-ticket-operation'; import { IncreasePaidStorageOperation } from '../operations/increase-paid-storage-operation'; import { BallotOperation } from '../operations/ballot-operation'; import { DrainDelegateOperation } from '../operations/drain-delegate-operation'; import { ProposalsOperation } from '../operations/proposals-operation'; import { UpdateConsensusKeyOperation } from '../operations/update-consensus-key-operation'; import { UpdateCompanionKeyOperation } from '../operations/update-companion-key-operation'; import { SmartRollupAddMessagesOperation } from '../operations/smart-rollup-add-messages-operation'; import { SmartRollupOriginateOperation } from '../operations/smart-rollup-originate-operation'; import { SmartRollupExecuteOutboxMessageOperation } from '../operations/smart-rollup-execute-outbox-message-operation'; import { Provider } from '../provider'; import { FailingNoopOperation } from '../operations/failing-noop-operation'; import { BlockIdentifier } from '../read-provider/interface'; export declare class RpcContractProvider extends Provider implements ContractProvider, StorageProvider { private estimator; constructor(context: Context, estimator: EstimationProvider); contractProviderTypeSymbol: symbol; private prepare; /** * * Return a well formatted json object of the contract storage * * @param contract contract address you want to get the storage from * @param schema optional schema can either be the contract script rpc response or a michelson-encoder schema * @throws {@link InvalidContractAddressError} * @see https://tezos.gitlab.io/api/rpc.html#get-block-id-context-contracts-contract-id-script */ getStorage(contract: string, schema?: ContractSchema, block?: BlockIdentifier): Promise; /** * * Return a well formatted json object of a big map value * * @param id Big Map ID * @param keyToEncode key to query (will be encoded properly according to the schema) * @param schema Big Map schema (can be determined using your contract type) * @param block optional block level to fetch the values from * * @see https://tezos.gitlab.io/api/rpc.html#get-block-id-context-big-maps-big-map-id-script-expr */ getBigMapKeyByID(id: string, keyToEncode: BigMapKeyType, schema: Schema, block?: BlockIdentifier): Promise; /** * * Fetch multiple values in a big map * All values will be fetched on the same block level. If a block is specified in the request, the values will be fetched at it. * Otherwise, a first request will be done to the node to fetch the level of the head and all values will be fetched at this level. * If one of the keys does not exist in the big map, its value will be set to undefined. * * @param id Big Map ID * @param keys Array of keys to query (will be encoded properly according to the schema) * @param schema Big Map schema (can be determined using your contract type) * @param block optional block level to fetch the values from * @param batchSize optional batch size representing the number of requests to execute in parallel * @returns A MichelsonMap containing the keys queried in the big map and their value in a well-formatted JSON object format * */ getBigMapKeysByID(id: string, keys: Array, schema: Schema, block?: BlockIdentifier, batchSize?: number): Promise>; private getBlockForRequest; private getBigMapValueOrUndefined; /** * * Return a well formatted json object of a sapling state * * @param id Sapling state ID * @param block optional block level to fetch the value from * */ getSaplingDiffByID(id: string, block?: BlockIdentifier): Promise; /** * * Originate a new contract according to the script in parameters. Will sign and inject an operation using the current context * * @returns An operation handle with the result from the rpc node * * @warn You cannot specify storage and init at the same time (use init to pass the raw michelson representation of storage) * * @param params Originate operation parameter */ originate(params: OriginateParams>): Promise>; /** * * Set the delegate for a contract. Will sign and inject an operation using the current context * * @returns An operation handle with the result from the rpc node * * @param params SetDelegate operation parameter */ setDelegate(params: DelegateParams): Promise; /** * * Register the current address as delegate. Will sign and inject an operation using the current context * * @returns An operation handle with the result from the rpc node * * @param params RegisterDelegate operation parameter */ registerDelegate(params: RegisterDelegateParams): Promise; /** * * Transfer tz from current address to a specific address. Will sign and inject an operation using the current context * * @returns An operation handle with the result from the rpc node * * @param params Transfer operation parameter */ transfer(params: TransferParams): Promise; /** * * Stake a given amount for the source address * * @returns An operation handle with the result from the rpc node * * @param params Stake pseudo-operation parameter */ stake(params: StakeParams): Promise; /** * * Unstake the given amount. If "everything" is given as amount, unstakes everything from the staking balance. * Unstaked tez remains frozen for a set amount of cycles (the slashing period) after the operation. Once this period is over, * the operation "finalize unstake" must be called for the funds to appear in the liquid balance. * * @returns An operation handle with the result from the rpc node * * @param params Unstake pseudo-operation parameter */ unstake(params: UnstakeParams): Promise; /** * * Transfer all the finalizable unstaked funds of the source to their liquid balance * @returns An operation handle with the result from the rpc node * * @param params Finalize_unstake pseudo-operation parameter */ finalizeUnstake(params: FinalizeUnstakeParams): Promise; /** * * Transfer Tickets to a smart contract address * * @returns An operation handle with the result from the rpc node * * @param params TransferTicket operation parameter */ transferTicket(params: TransferTicketParams): Promise; /** * * Reveal the public key of the current address. Will throw an error if the address is already revealed. * @returns An operation handle with the result from the rpc node * * @param params Reveal operation parameter */ reveal(params: RevealParams): Promise; /** * * Register a Micheline expression in a global table of constants. Will sign and inject an operation using the current context * * @returns An operation handle with the result from the rpc node * * @param params registerGlobalConstant operation parameter */ registerGlobalConstant(params: RegisterGlobalConstantParams): Promise; /** * * Increase the paid storage of a smart contract * * @returns An operation handle with the result from the rpc node * * @param params increasePaidStorage operation parameter */ increasePaidStorage(params: IncreasePaidStorageParams): Promise; /** * * Transfers the spendable balance of the delegate to destination when consensus_key is the active consensus key of delegate * * @returns An operation handle with the result from the rpc node * * @param params drainDelegate operation parameter */ drainDelegate(params: DrainDelegateParams): Promise; /** * * Submit a ballot vote to a specified proposal * * @returns An operation handle with the result from the rpc node * * @param params Ballot operation parameter */ ballot(params: BallotParams): Promise; /** * * Submit or upvote a proposal during the Proposal period * * @returns An operation handle with the result from the rpc node * * @param params Proposals operation parameter */ proposals(params: ProposalsParams): Promise; /** * * Update the consensus key of a delegate starting from the current cycle plus CONSENSUS_RIGHTS_DELAY + 1 * @returns An operation handle with the result from the rpc node * * @param params UpdateConsensusKey operation parameter */ updateConsensusKey(params: UpdateConsensusKeyParams): Promise; /** * * Updates the companion key of the delegate starting from the current cycle plus CONSENSUS_KEY_ACTIVATION_DELAY + 1 * @returns An operation handle with the result from the rpc node * * @param params UpdateCompanionKey operation parameter */ updateCompanionKey(params: UpdateCompanionKeyParams): Promise; /** * Adds messages to the rollup inbox that can be executed/claimed after it gets cemented * @param params SmartRollupAddMessages operation parameter * @returns An operation handle with results from the RPC node */ smartRollupAddMessages(params: SmartRollupAddMessagesParams): Promise; /** * Creates a smart rollup originate operation * @param params SmartRollupOriginate operation parameter * @returns An operation handle with results from the RPC node */ smartRollupOriginate(params: SmartRollupOriginateParams): Promise; /** * Execute a message from a smart rollup's outbox of a cemented commitment * @param params SmartRollupExecuteOutboxMessage operation parameter * @returns An operation handle with results from the RPC node */ smartRollupExecuteOutboxMessage(params: SmartRollupExecuteOutboxMessageParams): Promise; /** * * A failing_noop operation that is guaranteed to fail. * * @returns A FailingNoopOperation object representing the signed failing_noop operation * * @param params failingNoop operation parameter */ failingNoop(params: FailingNoopParams): Promise; /** * * Create an smart contract abstraction for the address specified. * * @param address Smart contract address * @throws {@link InvalidContractAddressError} */ at(address: string, contractAbstractionComposer?: ContractAbstractionComposer, block?: BlockIdentifier): Promise; atExactBlock(address: string, contractAbstractionComposer: ContractAbstractionComposer | undefined, block: BlockIdentifier): Promise; /** * * Batch a group of operation together. Operations will be applied in the order in which they are added to the batch * * @returns A batch object from which we can add more operation or send a command to execute the batch * * @param params List of operation to batch together */ batch(params?: ParamsWithKind[]): OperationBatch; } type ContractAbstractionComposer = (abs: ContractAbstraction, context: Context) => T; export {};