mnee
Version:
Legacy package for interacting with MNEE USD stablecoin. Includes experimental features.
64 lines (63 loc) • 3.57 kB
TypeScript
import { PrivateKey, Script, Transaction } from '@bsv/sdk';
import { GetSignatures, MNEEBalance, MNEEConfig, SdkConfig, MNEEUtxo, ParseTxResponse, ParseTxExtendedResponse, ParseOptions, SendMNEE, TransferMultiOptions, SignatureRequest, SignatureResponse, TxHistoryResponse, AddressHistoryParams, TransferResponse, TransferStatus, TransferOptions, UnsignedTransactionResult, MultisigBuildOptions } from './mnee.types.js';
export declare class MNEEService {
private mneeApiKey;
private mneeConfig;
private mneeApi;
constructor(config: SdkConfig);
getCosignerConfig(): Promise<MNEEConfig>;
toAtomicAmount(amount: number): number;
fromAtomicAmount(amount: number): number;
createInscriptionOutput(recipient: string, amount: number, config: MNEEConfig): Promise<{
lockingScript: Script;
satoshis: number;
}>;
getUtxos(address: string | string[], page?: number, size?: number, order?: 'asc' | 'desc'): Promise<MNEEUtxo[]>;
fetchSourceTransaction(txid: string, retries?: number): Promise<Transaction | undefined>;
generateSignatures(request: GetSignatures, privateKey: PrivateKey): Promise<{
sigResponses?: SignatureResponse[];
error?: {
message: string;
cause?: any;
};
}>;
getEnoughUtxos(address: string, totalAtomicTokenAmount: number): Promise<MNEEUtxo[]>;
getAllUtxos(address: string): Promise<MNEEUtxo[]>;
transfer(request: SendMNEE[], wif: string, transferOptions?: TransferOptions): Promise<TransferResponse>;
submitRawTx(rawtx: string, transferOptions?: TransferOptions): Promise<TransferResponse>;
getTxStatus(ticketId: string): Promise<TransferStatus>;
getBalance(address: string): Promise<MNEEBalance>;
getBalances(addresses: string[]): Promise<MNEEBalance[]>;
private processMneeValidation;
validateMneeTx(rawTx: string, request?: SendMNEE[]): Promise<boolean>;
private getMneeSyncs;
getRecentTxHistory(address: string, fromScore?: number, limit?: number, order?: 'asc' | 'desc'): Promise<TxHistoryResponse>;
getRecentTxHistories(params: AddressHistoryParams[]): Promise<TxHistoryResponse[]>;
/**
* Parses inscription data from a script
* @param script The script to parse
* @returns The parsed inscription data or null if invalid
*/
private parseInscriptionData;
private determineEnvironment;
private determineTransactionType;
private processTransactionInputs;
private processTransactionOutputs;
private validateTransaction;
private buildParseResponse;
private parseTransaction;
parseTx(txid: string, options?: ParseOptions): Promise<ParseTxResponse | ParseTxExtendedResponse>;
parseTxFromRawTx(rawTxHex: string, options?: ParseOptions): Promise<ParseTxResponse | ParseTxExtendedResponse>;
parseInscription(script: Script): import("./mnee.types.js").Inscription | undefined;
parseCosignerScripts(scripts: Script[]): import("./mnee.types.js").ParsedCosigner[];
private validateUniqueInputs;
private addInputsToTransaction;
private calculateTransferMultiFee;
private addChangeOutputs;
createSignatureRequests(tx: Transaction): SignatureRequest[];
private signAllInputs;
applySignatures(tx: Transaction, signatures: SignatureResponse[]): Transaction;
buildUnsignedMneeTransaction(options: MultisigBuildOptions): Promise<UnsignedTransactionResult>;
private validateTokenConservation;
transferMulti(options: TransferMultiOptions, transferOptions?: TransferOptions): Promise<TransferResponse>;
}