@taquito/taquito
Version:
High level functionality that builds upon the other packages in the Tezos Typescript Library Suite.
90 lines (89 loc) • 4.43 kB
TypeScript
import { Schema } from '@taquito/michelson-encoder';
import { Context } from '../context';
import { DelegateOperation } from '../operations/delegate-operation';
import { OperationEmitter } from '../operations/operation-emitter';
import { OriginationOperation } from '../operations/origination-operation';
import { TransactionOperation } from '../operations/transaction-operation';
import { DelegateParams, OriginateParams, RegisterDelegateParams, TransferParams } from '../operations/types';
import { ContractAbstraction } from './contract';
import { ContractProvider, ContractSchema, EstimationProvider, StorageProvider } from './interface';
export declare class RpcContractProvider extends OperationEmitter implements ContractProvider, StorageProvider {
private estimator;
constructor(context: Context, estimator: EstimationProvider);
contractProviderTypeSymbol: symbol;
/**
*
* @description 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
*
* @see https://tezos.gitlab.io/api/rpc.html#get-block-id-context-contracts-contract-id-script
*/
getStorage<T>(contract: string, schema?: ContractSchema): Promise<T>;
/**
*
* @description Return a well formatted json object of the contract big map storage
*
* @param contract contract address you want to get the storage from
* @param key contract big map key to fetch value from
* @param schema optional schema can either be the contract script rpc response or a michelson-encoder schema
*
* @deprecated Deprecated in favor of getBigMapKeyByID
*
* @see https://tezos.gitlab.io/api/rpc.html#get-block-id-context-contracts-contract-id-script
*/
getBigMapKey<T>(contract: string, key: string, schema?: ContractSchema): Promise<T>;
/**
*
* @description 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)
*
* @see https://tezos.gitlab.io/api/rpc.html#get-block-id-context-big-maps-big-map-id-script-expr
*/
getBigMapKeyByID<T>(id: string, keyToEncode: string, schema: Schema): Promise<T>;
/**
*
* @description 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 OriginationOperation Originate operation parameter
*/
originate(params: OriginateParams): Promise<OriginationOperation>;
/**
*
* @description 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 SetDelegate operation parameter
*/
setDelegate(params: DelegateParams): Promise<DelegateOperation>;
/**
*
* @description 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 RegisterDelegate operation parameter
*/
registerDelegate(params: RegisterDelegateParams): Promise<DelegateOperation>;
/**
*
* @description 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 Transfer operation parameter
*/
transfer(params: TransferParams): Promise<TransactionOperation>;
at<T extends ContractAbstraction<ContractProvider>>(address: string, contractAbstractionComposer?: ContractAbstractionComposer<T>): Promise<T>;
}
declare type ContractAbstractionComposer<T> = (abs: ContractAbstraction<ContractProvider>, context: Context) => T;
export {};