import { Context } from '../context'; import { ContractAbstraction, ContractStorageType, DefaultWalletType, SendParams } from '../contract'; import { ContractMethod } from '../contract/contract-methods/contract-method-flat-param'; import { ContractMethodObject } from '../contract/contract-methods/contract-method-object-param'; import { OpKind, withKind } from '../operations/types'; import { OriginationWalletOperation } from './origination-operation'; import { WalletDelegateParams, WalletFailingNoopParams, WalletIncreasePaidStorageParams, WalletOriginateParams, WalletProvider, WalletTransferParams, WalletStakeParams, WalletUnstakeParams, WalletFinalizeUnstakeParams } from './interface'; export interface PKHOption { forceRefetch?: boolean; } export type WalletParamsWithKind = withKind | withKind | withKind | withKind; export declare class WalletOperationBatch { private walletProvider; private context; private operations; constructor(walletProvider: WalletProvider, context: Context); /** * @description Add a transaction operation to the batch * @param params Transfer operation parameter */ withTransfer(params: WalletTransferParams): this; /** * @description Add a contract call to the batch * @param params Call a contract method * @param options Generic operation parameters */ withContractCall(params: ContractMethod | ContractMethodObject, options?: Partial): this; /** * @description Add a delegation operation to the batch * @param params Delegation operation parameter */ withDelegation(params: WalletDelegateParams): this; /** * @description Add an origination operation to the batch * @param params Origination operation parameter */ withOrigination(params: WalletOriginateParams>): this; /** * @description Add an IncreasePaidStorage operation to the batch * @param param IncreasePaidStorage operation parameter */ withIncreasePaidStorage(params: WalletIncreasePaidStorageParams): this; private mapOperation; /** * @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: WalletParamsWithKind[]): this; /** * @description Submit batch operation to wallet */ send(): Promise; } export declare class Wallet { private context; constructor(context: Context); private get walletProvider(); private _pkh?; private _pk?; /** * @description Retrieve the PKH of the account that is currently in use by the wallet * @param option Option to use while fetching the PKH. * If forceRefetch is specified the wallet provider implementation will refetch the PKH from the wallet */ pkh({ forceRefetch }?: PKHOption): Promise; /** * @description Retrieve the PK of the account that is currently in use by the wallet * @param option Option to use while fetching the PK. * If forceRefetch is specified the wallet provider implementation will refetch the PK from the wallet */ pk({ forceRefetch }?: PKHOption): Promise; private walletCommand; /** * @description Originate a new contract according to the script in parameters. * @returns a OriginationWalletOperation promise object when followed by .send() * @param originateParams Originate operation parameter */ originate(params: WalletOriginateParams>): { send: () => Promise>; }; /** * @description Set the delegate for a contract. * @returns a WalletDelegateParams promise object when followed by .send() * @param delegateParams operation parameter */ setDelegate(params: WalletDelegateParams): { send: () => Promise; }; /** * @description failing_noop operation that is guaranteed to fail. DISCLAIMER: Not all wallets support signing failing_noop operations. * @returns Signature for a failing_noop * @param params operation parameter */ signFailingNoop(params: WalletFailingNoopParams): Promise<{ signature: string; bytes: string; signedContent: { branch: string; contents: { kind: OpKind; arbitrary: string; }[]; }; }>; /** * @description Register the current address as delegate. * @returns a DelegationWalletOperation promise object when followed by .send() */ registerDelegate(): { send: () => Promise; }; /** * @description Transfer mavryk tokens from current address to a specific address or call a smart contract. * @returns a TransactionWalletOperation promise object when followed by .send() * @param params operation parameter */ transfer(params: WalletTransferParams): { send: () => Promise; }; /** * @description Stake a given amount for the source address * @returns a TransactionWalletOperation promise object when followed by .send() * @param Stake pseudo-operation parameter */ stake(params: WalletStakeParams): { send: () => Promise; }; /** * @description Unstake the given amount. If "everything" is given as amount, unstakes everything from the staking balance. * Unstaked mav 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 a TransactionWalletOperation promise object when followed by .send() * @param Unstake pseudo-operation parameter */ unstake(params: WalletUnstakeParams): { send: () => Promise; }; /** * @description Transfer all the finalizable unstaked funds of the source to their liquid balance * @returns a TransactionWalletOperation promise object when followed by .send() * @param Finalize_unstake pseudo-operation parameter */ finalizeUnstake(params: WalletFinalizeUnstakeParams): { send: () => Promise; }; /** * @description Increase the paid storage of a smart contract. * @returns a IncreasePaidStorageWalletOperation promise object when followed by .send() * @param params operation parameter */ increasePaidStorage(params: WalletIncreasePaidStorageParams): { send: () => Promise; }; /** * @description Create a batch of operation * @returns A batch object from which we can add more operation or send a command to the wallet to execute the batch * @param params List of operation to initialize the batch with */ batch(params?: Parameters[0]): WalletOperationBatch; /** * @description Create an smart contract abstraction for the address specified. Calling entrypoints with the returned * smart contract abstraction will leverage the wallet provider to make smart contract calls * @param address Smart contract address * @throws {@link InvalidContractAddressError} If the contract address is not valid */ at>(address: string, contractAbstractionComposer?: (abs: ContractAbstraction, context: Context) => T): Promise; /** * @deprecated Deprecated in favor of {@link Wallet.pk} will be removed in v19.1 * @description Retrieve the PK of the account that is currently in use by the wallet */ getPK(): Promise; }