wowok
Version:
Wowok Blockchain TypeScript API
36 lines (35 loc) • 2.29 kB
TypeScript
import type { Transaction, TransactionObjectArgument, TransactionResult } from "../../transactions/index.js";
import type { CallEnv, PassportObject, GuardObject, PaymentInfoObject, PaymentObject, AllocationObject, CoinObject, TypeNamedObject, AllocationAddress, ReceivedObject, CoinParam } from "../common.js";
import type { AllocationSharing, Allocators, PaymentInfo } from "../query/object.js";
import type { ReceivedBalanceOrRecently } from "../query/received.js";
import type { CallResult } from "./base.js";
import { CallBase } from "./base.js";
export type CallAllocation_Data = {
object: TypeNamedObject;
allocators: Allocators;
coin: CoinParam;
payment_info: PaymentInfo;
} | {
object: string;
received_coins?: ReceivedBalanceOrRecently;
alloc_by_guard?: string;
};
export declare class CallAllocation extends CallBase {
data: CallAllocation_Data;
object_address: string | undefined;
type_parameter: string | undefined;
constructor(data: CallAllocation_Data);
protected prepare(env: CallEnv): Promise<void>;
call(env: CallEnv): Promise<CallResult>;
operate(env: CallEnv, tx: Transaction, passport?: PassportObject): Promise<void>;
}
export declare function allocationFn(name: string): string;
export declare const MAX_ALLOCATOR_COUNT = 100;
export declare const MAX_SHARING_COUNT = 100;
export type AllocatorsType = TransactionObjectArgument;
export declare const sharing: (tx: Transaction, sharing: AllocationSharing, preResolvedAddress?: string) => Promise<TransactionResult>;
export declare const allocators: (tx: Transaction, param: Allocators) => Promise<AllocatorsType>;
export declare function alloc(tx: Transaction, allocation: AllocationObject, allocation_type: string, guard: GuardObject, passport: PassportObject): void;
export declare function newAllocation(tx: Transaction, allocation_type: string, coin: CoinObject, allocators: TransactionObjectArgument): AllocationObject;
export declare function create(tx: Transaction, allocation: TransactionObjectArgument, allocation_type: string, paymentInfo: PaymentInfoObject): AllocationAddress;
export declare function receive(tx: Transaction, allocation: AllocationObject, allocation_type: string, received: ReceivedObject, payment: PaymentObject): TransactionResult;