@mnee/ts-sdk 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,4 @@
1
+ import { Transaction } from "@bsv/sdk";
1
2
  export type Environment = 'production' | 'sandbox';
2
3
  export type SdkConfig = {
3
4
  environment: Environment;
@@ -254,3 +255,16 @@ export interface TxOutputResponse {
254
255
  environment?: Environment;
255
256
  type?: TxOperation;
256
257
  }
258
+ export interface UnsignedTransactionResult {
259
+ transaction: Transaction;
260
+ sigRequests: SignatureRequest[];
261
+ sourceTransactions: Map<number, Transaction>;
262
+ }
263
+ export interface MultisigBuildOptions {
264
+ inputs: Array<{
265
+ txid: string;
266
+ vout: number;
267
+ }>;
268
+ recipients: SendMNEE[];
269
+ changeAddress?: string | SendMNEE[];
270
+ }
@@ -1,5 +1,5 @@
1
- import { Script } from '@bsv/sdk';
2
- import { MNEEBalance, MNEEConfig, SdkConfig, MNEEUtxo, ParseTxResponse, ParseTxExtendedResponse, ParseOptions, SendMNEE, TransferMultiOptions, TxHistoryResponse, AddressHistoryParams, TransferResponse, TransferStatus, TransferOptions } from './mnee.types.js';
1
+ import { PrivateKey, Script, Transaction } from '@bsv/sdk';
2
+ import { GetSignatures, MNEEBalance, MNEEConfig, SdkConfig, MNEEUtxo, ParseTxResponse, ParseTxExtendedResponse, ParseOptions, SendMNEE, TransferMultiOptions, SignatureRequest, SignatureResponse, TxHistoryResponse, AddressHistoryParams, TransferResponse, TransferStatus, TransferOptions, MultisigBuildOptions, UnsignedTransactionResult } from './mnee.types.js';
3
3
  export declare class MNEEService {
4
4
  private mneeApiKey;
5
5
  private mneeConfig;
@@ -8,10 +8,19 @@ export declare class MNEEService {
8
8
  getCosignerConfig(): Promise<MNEEConfig>;
9
9
  toAtomicAmount(amount: number): number;
10
10
  fromAtomicAmount(amount: number): number;
11
- private createInscription;
11
+ createInscription(recipient: string, amount: number, config: MNEEConfig): Promise<{
12
+ lockingScript: Script;
13
+ satoshis: number;
14
+ }>;
12
15
  getUtxos(address: string | string[], page?: number, size?: number, order?: 'asc' | 'desc'): Promise<MNEEUtxo[]>;
13
- private fetchRawTx;
14
- private getSignatures;
16
+ fetchRawTx(txid: string, retries?: number): Promise<Transaction | undefined>;
17
+ getSignatures(request: GetSignatures, privateKey: PrivateKey): Promise<{
18
+ sigResponses?: SignatureResponse[];
19
+ error?: {
20
+ message: string;
21
+ cause?: any;
22
+ };
23
+ }>;
15
24
  getEnoughUtxos(address: string, totalAtomicTokenAmount: number): Promise<MNEEUtxo[]>;
16
25
  getAllUtxos(address: string): Promise<MNEEUtxo[]>;
17
26
  transfer(request: SendMNEE[], wif: string, transferOptions?: TransferOptions): Promise<TransferResponse>;
@@ -45,7 +54,10 @@ export declare class MNEEService {
45
54
  private addInputsToTransaction;
46
55
  private calculateTransferMultiFee;
47
56
  private addChangeOutputs;
57
+ createSignatureRequests(tx: Transaction): SignatureRequest[];
48
58
  private signAllInputs;
59
+ applySignatures(tx: Transaction, signatures: SignatureResponse[]): Transaction;
60
+ buildUnsignedMneeTransaction(options: MultisigBuildOptions): Promise<UnsignedTransactionResult>;
49
61
  private validateTokenConservation;
50
62
  transferMulti(options: TransferMultiOptions, transferOptions?: TransferOptions): Promise<TransferResponse>;
51
63
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.1.1",
6
+ "version": "1.1.2",
7
7
  "description": "Official typescript SDK of MNEE USD stablecoin",
8
8
  "type": "module",
9
9
  "source": "src/index.ts",