@zlattice/lattice-js
Version:
Lattice blockchain TypeScript SDK with dual module support (CJS + ESM)
34 lines • 1.19 kB
TypeScript
import { TransactionType } from "../../common/constants.js";
import { Addr, LatestBlock, Transaction, UInt64 } from "../../common/types/index.js";
/**
* Builder is a builder for the Transaction class.
* It is used to build a Transaction object.
*
* @param type - The type of the transaction.
* @returns A Builder object.
*/
interface Builder {
setBlock(block: LatestBlock): Builder;
setOwner(owner: Addr): Builder;
setLinker(linker: Addr): Builder;
setAmount(amount: UInt64): Builder;
setJoule(joule: UInt64): Builder;
setPayload(payload: string): Builder;
setCode(code: string): Builder;
build(): Transaction;
}
declare class TransactionBuilder implements Builder {
private tx;
constructor(type: TransactionType);
static builder(type: TransactionType): TransactionBuilder;
setBlock(block: LatestBlock): Builder;
setOwner(owner: Addr): Builder;
setLinker(linker: Addr): Builder;
setAmount(amount: UInt64): Builder;
setJoule(joule: UInt64): Builder;
setPayload(payload: string): Builder;
setCode(code: string): Builder;
build(): Transaction;
}
export { TransactionBuilder };
//# sourceMappingURL=index.d.ts.map