///
import { JWKInterface } from 'arweave/node/lib/wallet';
import { WarpPluginType } from '../../core/WarpPlugin';
import { EvaluationOptions } from '../../core/modules/StateEvaluator';
import { Source } from './Source';
import { Signer } from 'warp-arbundles';
import { CustomSignature } from '../Signature';
import { Tag } from '../../utils/types/arweave-types';
export type Tags = Tag[];
export type ArWallet = JWKInterface | 'use_wallet';
export type ContractType = 'js' | 'wasm';
export type ArTransfer = {
target: string;
winstonQty: string;
};
export declare const emptyTransfer: ArTransfer;
export type EvaluationManifest = {
evaluationOptions?: Partial;
plugins?: WarpPluginType[];
};
export declare const REGISTER_PROVIDER: readonly ["node1", "node2", "arweave"];
export type RegisterProviderType = (typeof REGISTER_PROVIDER)[number];
export interface CommonContractData {
wallet: ArWallet | CustomSignature | Signer;
initState: string;
tags?: Tags;
transfer?: ArTransfer;
data?: {
'Content-Type': string;
body: string | Buffer;
};
evaluationManifest?: EvaluationManifest;
}
export interface ContractData extends CommonContractData {
src: string | Buffer;
wasmSrcCodeDir?: string;
wasmGlueCode?: string;
}
export interface FromSrcTxContractData extends CommonContractData {
srcTxId: string;
}
export interface ContractDeploy {
contractTxId: string;
srcTxId?: string;
}
export interface CreateContract extends Source {
/**
* Allows to deploy contract. By default bundling is enabled. In this case, contract source data item and contract data item are
* created and posted to Warp Gateway where they're uploaded to Bundlr and indexed in the gateway. In case of bundling being disabled
* (or in local environment) contract transaction and contract source transaction are created, signed and posted directly to Arweave.
* @param contractData - contract data {@link ContractData},
* @param disableBundling - by default bundling is enabled and contract and contract source data item are being created, one can
* manually disable bundling, bundling is also disabled in local environment.
*
* Returns promise of type {@link ContractDeploy}
*/
deploy(contractData: ContractData, disableBundling?: boolean): Promise;
/**
* Allows to deploy contract from already existing source, contract source id is passed in a tag. By default bundling is enabled.
* In this case, contract data item is created and posted to Warp Gateway where it's uploaded to Bundlr and indexed in the gateway.
* In case of bundling being disabled(or in local environment) contract transaction is created, signed and posted directly to Arweave.
* @param contractData - contract data {@link FromSrcTxContractData},
* @param disableBundling - by default bundling is enabled and contract data item is created, one can manually disable bundling,
* bundling is also disabled in local environment.
*
* Returns promise of type {@link ContractDeploy}
*/
deployFromSourceTx(contractData: FromSrcTxContractData, disableBundling?: boolean): Promise;
/**
* Takes raw contract data item as an argument and posts it to Warp Gateway where it is uploaded to Bundlr and indexed. Only AtomicNFTs
* data items (containing dedicated tags) are accepted.
* @param rawDataItem
*
* Returns promise of type {@link ContractDeploy}
*/
deployBundled(rawDataItem: Buffer): Promise;
/**
* Registers contract transaction in Warp Gateway. One needs to upload contract transaction using e.g. Irys, Turbo
* or arbundles and pass its id in the method along with {@link RegisterProviderType} - 'node1' and 'node2' for contracts
* deployed using Irys and 'arweave' for contracts deployed through other providers (contracts metadata is then queried
* from Arweave gql).
* Contract dedicated tags are verified in the gateway.
* @param id - id of the uploaded contract transaction
* @param registerProvider - {@link RegisterProviderType}
*/
register(id: string, registerProvider: RegisterProviderType): Promise;
}
//# sourceMappingURL=CreateContract.d.ts.map