UNPKG

@taquito/taquito

Version:

High level functionality that builds upon the other packages in the Tezos Typescript Library Suite.

140 lines (139 loc) 5.95 kB
import { Context } from '../context'; import { ContractStorageType, DefaultContractType } from '../contract/contract'; import { SendParams } from '../contract/contract-methods/contract-method-interface'; import { ContractProvider } from '../contract/interface'; import { BatchOperation } from '../operations/batch-operation'; import { ActivationParams, DelegateParams, OriginateParams, TransferParams, ParamsWithKind, RegisterGlobalConstantParams, TransferTicketParams, IncreasePaidStorageParams, SmartRollupAddMessagesParams, SmartRollupOriginateParams, SmartRollupExecuteOutboxMessageParams, UpdateConsensusKeyParams, UpdateCompanionKeyParams } from '../operations/types'; import { ContractMethodObject } from '../contract/contract-methods/contract-method-object-param'; import { EstimationProvider } from '../estimate/estimate-provider-interface'; import { Provider } from '../provider'; export { BATCH_KINDS, BatchKinds } from './constants'; export declare class OperationBatch extends Provider { private estimator; private operations; constructor(context: Context, estimator: EstimationProvider); private prepare; /** * * @description Add a transaction operation to the batch * * @param params Transfer operation parameter */ withTransfer(params: TransferParams): this; /** * * @description Transfer tickets from a Tezos address (tz1,tz2 or tz3) to a smart contract address( KT1) * * @param params Transfer operation parameter */ withTransferTicket(params: TransferTicketParams): this; /** * * @description Add a contract call to the batch * * @param params Call a contract method * @param options Generic operation parameters */ withContractCall(params: ContractMethodObject<ContractProvider>, options?: Partial<SendParams>): this; /** * * @description Add a delegation operation to the batch * * @param params Delegation operation parameter */ withDelegation(params: DelegateParams): this; /** * * @description Add an activation operation to the batch * * @param params Activation operation parameter * @throws {@link InvalidKeyHashError} */ withActivation({ pkh, secret }: ActivationParams): this; /** * * @description Add an origination operation to the batch * * @param params Origination operation parameter */ withOrigination<TContract extends DefaultContractType = DefaultContractType>(params: OriginateParams<ContractStorageType<TContract>>): this; /** * * @description Add a register a global constant operation to the batch * * @param params RegisterGlobalConstant operation parameter */ withRegisterGlobalConstant(params: RegisterGlobalConstantParams): this; /** * * @description Add an increase paid storage operation to the batch * * @param params IncreasePaidStorage operation parameter */ withIncreasePaidStorage(params: IncreasePaidStorageParams): this; /** * * @description Add a update consensus key operation to the batch * * @param params UpdateConsensusKey operation parameter */ withUpdateConsensusKey(params: UpdateConsensusKeyParams): this; /** * * @description Add a update companion key operation to the batch * * @param params UpdateCompanionKey operation parameter */ withUpdateCompanionKey(params: UpdateCompanionKeyParams): this; /** * * @description Add a smart rollup add messages operation to the batch * * @param params Rollup origination operation parameter */ withSmartRollupAddMessages(params: SmartRollupAddMessagesParams): this; /** * * @description Add a smart rollup originate operation to the batch * * @param params Smart Rollup Originate operation parameter */ withSmartRollupOriginate(params: SmartRollupOriginateParams): this; /** * * @description Add a smart rollup execute outbox message to the batch * * @param params Smart Rollup Execute Outbox Message operation parameter */ withSmartRollupExecuteOutboxMessage(params: SmartRollupExecuteOutboxMessageParams): this; getRPCOp(param: ParamsWithKind): Promise<import("../operations/types").RPCTransferOperation | import("../operations/types").RPCOriginationOperation | import("../operations/types").RPCDelegateOperation | import("../operations/types").RPCRegisterGlobalConstantOperation | import("../operations/types").RPCIncreasePaidStorageOperation | import("../operations/types").RPCUpdateConsensusKeyOperation | import("../operations/types").RPCUpdateCompanionKeyOperation | import("../operations/types").RPCTransferTicketOperation | import("../operations/types").RPCSmartRollupAddMessagesOperation | import("../operations/types").RPCSmartRollupOriginateOperation | import("../operations/types").RPCSmartRollupOutboxMessageOperation>; /** * * @description Add a group operation to the batch. Operation will be applied in the order they are in the params array * * @param params Operations parameter * @throws {@link InvalidOperationKindError} */ with(params: ParamsWithKind[]): this; /** * * @description Forge and Inject the operation batch * * @param params Optionally specify the source of the operation */ send(params?: { source?: string; }): Promise<BatchOperation>; } export declare class RPCBatchProvider { private context; private estimator; constructor(context: Context, estimator: EstimationProvider); /*** * * @description Batch a group of operation together. Operations will be applied in the order in which they are added to the batch * * @param params List of operation to batch together */ batch(params?: ParamsWithKind[]): OperationBatch; }