import { AuthorizedOnBehalf, BurnTokenQuantity, TokenBurn, TokenBurnCounter, TokenInstanceKey, UserAlias } from "@gala-chain/api"; import { BigNumber } from "bignumber.js"; import { GalaChainContext } from "../types"; export interface BurnsTokensParams { owner: UserAlias; toBurn: BurnTokenQuantity[]; /** * @deprecated since 2.3.2. It is recommended to use `authorizedOnBehalf` instead. */ preValidated?: boolean; authorizedOnBehalf?: AuthorizedOnBehalf; } /** * @description * * Burn a quantity of tokens described by one or more `TokenInstanceKey`s * belonging to a single owner. * * @remarks * * The optional `preValidated?` boolean is intended for use internally by * other chaincode contract methods that have already validated * identities, allowances, and authorization to burn. * * For example, a * burning bridge may need to burn tokens while executing `bridgeTokenOut` * actions. * * @param ctx * @param param1 * @returns */ export declare function burnTokens(ctx: GalaChainContext, { owner, toBurn, preValidated, authorizedOnBehalf }: BurnsTokensParams): Promise; /** * @description * * Iterate through the provided array of `BurnTokenQuantity` objects, identifying any * duplicates by `tokenInstanceKey`. If more than one `BurnTokenQuantity` exist for a * given `tokenInstanceKey` combination, sum them together. The output array should have * at most one value per unique `tokenInstanceKey`. * * @param requests: BurnTokenQuantity[] * @returns BurnTokenQuantity[] */ export declare function aggregateBurnQuantities(requests: BurnTokenQuantity[]): BurnTokenQuantity[]; /** * @description * * If the `TokenBurn` can be read, increment the quantity. * Otherwise, create a new `TokenBurn` with the quantity set to the provided value. * * @remarks * The ChainKey design of `TokenBurn` objects ensures uniqueness by * burnedBy, tokenInstanceKey properties, and a created timestamp. * Generally if a `TokenBurn` is read twice in the same transaction it means * two `burnQuantities` were provided to `burnTokens` for the same token instance, * or two separate functions burned the same token (e.g. a fee and a chaincode main method execution.) */ export declare function incrementOrCreateTokenBurnForTx(ctx: GalaChainContext, burnedBy: UserAlias, { collection, category, type, additionalKey, instance }: TokenInstanceKey, quantity: BigNumber): Promise; /** * @description * * If the `TokenBurnCounter` can be read, increment the quantity. * Otherwise, create a new `TokenBurnCounter` with the quantity set to the provided value. * * @remarks * The ChainKey design of `TokenBurnCounter` ranged objects ensures uniqueness by * tokenInstanceKey properties, burnedBy, and a timeKey derived from the transaction timestamp. * Generally if a `TokenBurnCounter` is read twice in the same transaction it means * two `burnQuantities` were provided to `burnTokens` for the same token instance, * or two separate functions burned the same token (e.g. a fee and a chaincode main method execution.) */ export declare function incrementOrCreateTokenBurnCounterForTx(ctx: GalaChainContext, burnedBy: UserAlias, { collection, category, type, additionalKey, instance }: TokenInstanceKey, quantity: BigNumber): Promise; //# sourceMappingURL=burnTokens.d.ts.map