@2waychain/2wayjs
Version:
API wrapper to access the AIBlock 2 Way Chain
29 lines (28 loc) • 2.02 kB
TypeScript
import { ICreateTxPayload, IDruidExpectation, IFetchBalanceResponse, IKeypair, IItemCreationAPIPayload, IResult } from '../interfaces';
/**
* Create a payload needed to create item assets which is suitable for processing by a mempool node
*
* @export
* @param {Uint8Array} secretKey - Secret key as Uint8Array
* @param {Uint8Array} pubKey - Public key as Uint8Array
* @param {(number | null)} version - Address version
* @param {number} [amount=ITEM_DEFAULT] - Amount of the asset to create
* @param {boolean} [default_genesis_hash_spec=true] - Whether to use the default DRS transaction hash
* @param {string | null} [metadata=null] - Metadata to be included in the asset
* @return {*} {IResult<IItemCreationAPIPayload>}
*/
export declare function createItemPayload(secretKey: Uint8Array, pubKey: Uint8Array, version: number | null, amount?: number, default_genesis_hash_spec?: boolean, //genesis_hash_spec
metadata?: string | null): IResult<IItemCreationAPIPayload>;
/**
* Create one "half" of a 2 way payment
*
* @export
* @param {IFetchBalanceResponse} fetchBalanceResponse - Balance as received from the mempool node
* @param {string} druid - Unique DRUID value associated with this transaction; needs to match the other "half" of this 2 way payment
* @param {IDruidExpectation} senderExpectation - Expectation for the sender of this transaction
* @param {IDruidExpectation} receiverExpectation - Expectation for the receiver of this transaction
* @param {string} excessAddress - Address to send excess funds to (owned by sender of this "half" of the transaction)
* @param {Map<string, IKeypair>} allKeypairs - Map of all keypairs
* @return {*} {IResult<ICreateTxPayload>}
*/
export declare function create2WTxHalf(fetchBalanceResponse: IFetchBalanceResponse, druid: string, senderExpectation: IDruidExpectation, receiverExpectation: IDruidExpectation, excessAddress: string, allKeypairs: Map<string, IKeypair>, locktime: number): IResult<ICreateTxPayload>;