@btc-vision/transaction 1.0.93 → 1.0.94

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,7 +1,16 @@
1
- import { IInteractionParameters } from '../interfaces/ITransactionParameters.js';
1
+ import {
2
+ IDeploymentParameters,
3
+ IInteractionParameters,
4
+ IUnwrapParameters,
5
+ IWrapParameters,
6
+ } from '../interfaces/ITransactionParameters.js';
2
7
  import { UTXO } from '../../utxo/interfaces/IUTXO.js';
8
+ import { DeploymentResult, UnwrapResult, WrapResult } from '../TransactionFactory';
3
9
 
4
- export type InteractionParametersWithoutSigner = Omit<IInteractionParameters, 'signer'>; //| 'utxos'
10
+ export type InteractionParametersWithoutSigner = Omit<IInteractionParameters, 'signer'>;
11
+ export type IWrapParametersWithoutSigner = Omit<IWrapParameters, 'signer'>;
12
+ export type IUnwrapParametersSigner = Omit<IUnwrapParameters, 'signer'>;
13
+ export type IDeploymentParametersWithoutSigner = Omit<IDeploymentParameters, 'signer' | 'network'>;
5
14
 
6
15
  export interface BroadcastTransactionOptions {
7
16
  raw: string;
@@ -42,5 +51,11 @@ export interface Web3Provider {
42
51
  interactionParameters: InteractionParametersWithoutSigner,
43
52
  ): Promise<[BroadcastedTransaction, BroadcastedTransaction, UTXO[]]>;
44
53
 
54
+ deployContract(params: IDeploymentParametersWithoutSigner): Promise<DeploymentResult>;
55
+
45
56
  broadcast(transactions: BroadcastTransactionOptions[]): Promise<BroadcastedTransaction[]>;
57
+
58
+ wrap(wrapParameters: IWrapParametersWithoutSigner): Promise<WrapResult>;
59
+
60
+ unwrap(unwrapParameters: IUnwrapParametersSigner): Promise<UnwrapResult>;
46
61
  }
@@ -9,6 +9,7 @@ import { TapScriptSig } from 'bip174/src/lib/interfaces.js';
9
9
  declare global {
10
10
  interface Window {
11
11
  unisat?: Unisat;
12
+ opnet?: Unisat;
12
13
  }
13
14
  }
14
15
 
@@ -98,7 +99,7 @@ export class UnisatSigner extends CustomKeypair {
98
99
  this._network = networks.regtest;
99
100
  break;
100
101
  default:
101
- throw new Error('Invalid network');
102
+ throw new Error(`Invalid network: ${network}`);
102
103
  }
103
104
 
104
105
  const publicKey = await this.unisat.getPublicKey();