@btc-vision/transaction 1.0.123 → 1.1.0
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.
- package/browser/_version.d.ts +1 -1
- package/browser/consensus/ConsensusConfig.d.ts +0 -4
- package/browser/index.js +1 -1
- package/browser/opnet.d.ts +0 -6
- package/browser/transaction/TransactionFactory.d.ts +1 -13
- package/browser/transaction/browser/Web3Provider.d.ts +2 -6
- package/browser/transaction/browser/extensions/UnisatSigner.d.ts +3 -0
- package/browser/transaction/interfaces/ITransactionParameters.d.ts +0 -14
- package/browser/transaction/processor/PsbtTransaction.d.ts +0 -15
- package/browser/utils/BitcoinUtils.d.ts +0 -3
- package/browser/utxo/OPNetLimitedProvider.d.ts +1 -5
- package/build/_version.d.ts +1 -1
- package/build/_version.js +1 -1
- package/build/consensus/ConsensusConfig.d.ts +0 -4
- package/build/consensus/metadata/RoswellConsensus.js +0 -4
- package/build/opnet.d.ts +0 -6
- package/build/opnet.js +0 -6
- package/build/transaction/TransactionFactory.d.ts +1 -13
- package/build/transaction/TransactionFactory.js +1 -161
- package/build/transaction/browser/Web3Provider.d.ts +2 -6
- package/build/transaction/browser/extensions/UnisatSigner.d.ts +3 -0
- package/build/transaction/browser/extensions/UnisatSigner.js +65 -3
- package/build/transaction/interfaces/ITransactionParameters.d.ts +0 -14
- package/build/transaction/processor/PsbtTransaction.d.ts +0 -15
- package/build/transaction/processor/PsbtTransaction.js +0 -9
- package/build/utils/BitcoinUtils.d.ts +0 -3
- package/build/utils/BitcoinUtils.js +0 -19
- package/build/utxo/OPNetLimitedProvider.d.ts +1 -5
- package/build/utxo/OPNetLimitedProvider.js +0 -28
- package/package.json +1 -1
- package/src/_version.ts +1 -1
- package/src/consensus/ConsensusConfig.ts +4 -4
- package/src/consensus/metadata/RoswellConsensus.ts +4 -4
- package/src/opnet.ts +6 -6
- package/src/transaction/TransactionFactory.ts +13 -25
- package/src/transaction/browser/Web3Provider.ts +1 -9
- package/src/transaction/browser/extensions/UnisatSigner.ts +83 -3
- package/src/transaction/builders/SharedInteractionTransaction.ts +0 -1
- package/src/transaction/builders/{WrapTransaction.ts → WrapTransaction.ts.disabled} +1 -1
- package/src/transaction/interfaces/ITransactionParameters.ts +2 -5
- package/src/transaction/processor/PsbtTransaction.ts +4 -4
- package/src/utils/BitcoinUtils.ts +4 -5
- package/src/utxo/OPNetLimitedProvider.ts +5 -9
- package/{src/wbtc/Generate.ts → wbtc_disabled/Generate.ts.disabled} +1 -1
- package/{src/wbtc/UnwrapGeneration.ts → wbtc_disabled/UnwrapGeneration.ts.disabled} +1 -1
- package/browser/metadata/contracts/wBTC.d.ts +0 -13
- package/browser/transaction/builders/UnwrapSegwitTransaction.d.ts +0 -32
- package/browser/transaction/builders/UnwrapTransaction.d.ts +0 -41
- package/browser/transaction/builders/WrapTransaction.d.ts +0 -29
- package/browser/wbtc/Generate.d.ts +0 -18
- package/browser/wbtc/UnwrapGeneration.d.ts +0 -7
- package/browser/wbtc/WrappedGenerationParameters.d.ts +0 -10
- package/build/metadata/contracts/wBTC.d.ts +0 -13
- package/build/metadata/contracts/wBTC.js +0 -34
- package/build/transaction/builders/UnwrapSegwitTransaction.d.ts +0 -32
- package/build/transaction/builders/UnwrapSegwitTransaction.js +0 -179
- package/build/transaction/builders/UnwrapTransaction.d.ts +0 -41
- package/build/transaction/builders/UnwrapTransaction.js +0 -258
- package/build/transaction/builders/WrapTransaction.d.ts +0 -29
- package/build/transaction/builders/WrapTransaction.js +0 -146
- package/build/wbtc/Generate.d.ts +0 -18
- package/build/wbtc/Generate.js +0 -1
- package/build/wbtc/UnwrapGeneration.d.ts +0 -7
- package/build/wbtc/UnwrapGeneration.js +0 -6
- package/build/wbtc/WrappedGenerationParameters.d.ts +0 -10
- package/build/wbtc/WrappedGenerationParameters.js +0 -10
- package/src/metadata/contracts/wBTC.ts +0 -59
- /package/src/transaction/builders/{UnwrapSegwitTransaction.ts → UnwrapSegwitTransaction.ts.disabled} +0 -0
- /package/src/transaction/builders/{UnwrapTransaction.ts → UnwrapTransaction.ts.disabled} +0 -0
- /package/{src/wbtc/WrappedGenerationParameters.ts → wbtc_disabled/WrappedGenerationParameters.ts.disabled} +0 -0
package/browser/opnet.d.ts
CHANGED
|
@@ -13,7 +13,6 @@ export * from './keypair/EcKeyPair.js';
|
|
|
13
13
|
export * from './keypair/Wallet.js';
|
|
14
14
|
export * from './keypair/interfaces/IWallet.js';
|
|
15
15
|
export * from './keypair/AddressVerificator.js';
|
|
16
|
-
export * from './metadata/contracts/wBTC.js';
|
|
17
16
|
export * from './metadata/ContractBaseMetadata.js';
|
|
18
17
|
export * from './signer/TweakedSigner.js';
|
|
19
18
|
export * from './transaction/TransactionFactory.js';
|
|
@@ -23,14 +22,10 @@ export * from './transaction/enums/TransactionType.js';
|
|
|
23
22
|
export * from './transaction/builders/InteractionTransaction.js';
|
|
24
23
|
export * from './transaction/builders/FundingTransaction.js';
|
|
25
24
|
export * from './transaction/builders/TransactionBuilder.js';
|
|
26
|
-
export * from './transaction/builders/WrapTransaction.js';
|
|
27
25
|
export * from './transaction/builders/SharedInteractionTransaction.js';
|
|
28
26
|
export * from './transaction/builders/DeploymentTransaction.js';
|
|
29
|
-
export * from './transaction/builders/UnwrapTransaction.js';
|
|
30
27
|
export * from './transaction/builders/CustomScriptTransaction.js';
|
|
31
28
|
export * from './transaction/builders/MultiSignTransaction.js';
|
|
32
|
-
export * from './wbtc/WrappedGenerationParameters.js';
|
|
33
|
-
export * from './wbtc/Generate.js';
|
|
34
29
|
export * from './network/ChainId.js';
|
|
35
30
|
export * from './utils/BitcoinUtils.js';
|
|
36
31
|
export * from './utxo/interfaces/IUTXO.js';
|
|
@@ -40,7 +35,6 @@ export * from './transaction/shared/TweakedTransaction.js';
|
|
|
40
35
|
export * from './utxo/interfaces/BroadcastResponse.js';
|
|
41
36
|
export * from './transaction/psbt/PSBTTypes.js';
|
|
42
37
|
export * from './transaction/shared/P2TR_MS.js';
|
|
43
|
-
export * from './wbtc/UnwrapGeneration.js';
|
|
44
38
|
export * from './consensus/ConsensusConfig.js';
|
|
45
39
|
export * from './consensus/Consensus.js';
|
|
46
40
|
export * from './consensus/metadata/RoswellConsensus.js';
|
|
@@ -4,7 +4,7 @@ import { ICustomTransactionParameters } from './builders/CustomScriptTransaction
|
|
|
4
4
|
import { FundingTransaction } from './builders/FundingTransaction.js';
|
|
5
5
|
import { TransactionBuilder } from './builders/TransactionBuilder.js';
|
|
6
6
|
import { TransactionType } from './enums/TransactionType.js';
|
|
7
|
-
import { IDeploymentParameters, IFundingTransactionParameters, IInteractionParameters
|
|
7
|
+
import { IDeploymentParameters, IFundingTransactionParameters, IInteractionParameters } from './interfaces/ITransactionParameters.js';
|
|
8
8
|
export interface DeploymentResult {
|
|
9
9
|
readonly transaction: [string, string];
|
|
10
10
|
readonly contractAddress: string;
|
|
@@ -31,25 +31,13 @@ export interface BitcoinTransferResponse {
|
|
|
31
31
|
readonly estimatedFees: bigint;
|
|
32
32
|
readonly nextUTXOs: UTXO[];
|
|
33
33
|
}
|
|
34
|
-
export interface UnwrapResult {
|
|
35
|
-
readonly fundingTransaction: string;
|
|
36
|
-
readonly psbt: string;
|
|
37
|
-
readonly feeRefundOrLoss: bigint;
|
|
38
|
-
readonly utxos: UTXO[];
|
|
39
|
-
}
|
|
40
34
|
export declare class TransactionFactory {
|
|
41
35
|
createCustomScriptTransaction(interactionParameters: ICustomTransactionParameters): Promise<[string, string, UTXO[]]>;
|
|
42
36
|
signInteraction(interactionParameters: IInteractionParameters): Promise<[string, string, UTXO[]]>;
|
|
43
37
|
signDeployment(deploymentParameters: IDeploymentParameters): Promise<DeploymentResult>;
|
|
44
|
-
wrap(wrapParameters: Omit<IWrapParameters, 'calldata'>): Promise<WrapResult>;
|
|
45
|
-
unwrapSegwit(unwrapParameters: IUnwrapParameters): Promise<UnwrapResult>;
|
|
46
|
-
unwrap(unwrapParameters: IUnwrapParameters): Promise<UnwrapResult>;
|
|
47
38
|
createBTCTransfer(parameters: IFundingTransactionParameters): Promise<BitcoinTransferResponse>;
|
|
48
39
|
getAllNewUTXOs(original: TransactionBuilder<TransactionType>, tx: Transaction, to: string): UTXO[];
|
|
49
40
|
private createFundTransaction;
|
|
50
|
-
private calculateNumSignatures;
|
|
51
|
-
private calculateNumInputs;
|
|
52
|
-
private maxPubKeySize;
|
|
53
41
|
private writePSBTHeader;
|
|
54
42
|
private getPriorityFee;
|
|
55
43
|
private getUTXOAsTransaction;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { IDeploymentParameters, IInteractionParameters
|
|
1
|
+
import { IDeploymentParameters, IInteractionParameters } from '../interfaces/ITransactionParameters.js';
|
|
2
2
|
import { UTXO } from '../../utxo/interfaces/IUTXO.js';
|
|
3
|
-
import { DeploymentResult
|
|
3
|
+
import { DeploymentResult } from '../TransactionFactory';
|
|
4
4
|
export type InteractionParametersWithoutSigner = Omit<IInteractionParameters, 'signer'>;
|
|
5
|
-
export type IWrapParametersWithoutSigner = Omit<IWrapParameters, 'signer'>;
|
|
6
|
-
export type IUnwrapParametersWithoutSigner = Omit<IUnwrapParameters, 'signer'>;
|
|
7
5
|
export type IDeploymentParametersWithoutSigner = Omit<IDeploymentParameters, 'signer' | 'network'>;
|
|
8
6
|
export interface BroadcastTransactionOptions {
|
|
9
7
|
raw: string;
|
|
@@ -21,6 +19,4 @@ export interface Web3Provider {
|
|
|
21
19
|
signAndBroadcastInteraction(interactionParameters: InteractionParametersWithoutSigner): Promise<[BroadcastedTransaction, BroadcastedTransaction, UTXO[]]>;
|
|
22
20
|
deployContract(params: IDeploymentParametersWithoutSigner): Promise<DeploymentResult>;
|
|
23
21
|
broadcast(transactions: BroadcastTransactionOptions[]): Promise<BroadcastedTransaction[]>;
|
|
24
|
-
wrap(wrapParameters: IWrapParametersWithoutSigner): Promise<WrapResult>;
|
|
25
|
-
unwrap(unwrapParameters: IUnwrapParametersWithoutSigner): Promise<UnwrapResult>;
|
|
26
22
|
}
|
|
@@ -28,7 +28,10 @@ export declare class UnisatSigner extends CustomKeypair {
|
|
|
28
28
|
verify(hash: Buffer, signature: Buffer): boolean;
|
|
29
29
|
signTaprootInput(transaction: Psbt, i: number, sighashTypes: number[]): Promise<void>;
|
|
30
30
|
signInput(transaction: Psbt, i: number, sighashTypes: number[]): Promise<void>;
|
|
31
|
+
private hasAlreadySignedTapScriptSig;
|
|
32
|
+
private hasAlreadyPartialSig;
|
|
31
33
|
private combine;
|
|
34
|
+
private signAllTweaked;
|
|
32
35
|
private signTweaked;
|
|
33
36
|
private getNonDuplicateScriptSig;
|
|
34
37
|
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { UTXO } from '../../utxo/interfaces/IUTXO.js';
|
|
2
|
-
import { WrappedGeneration } from '../../wbtc/WrappedGenerationParameters.js';
|
|
3
2
|
import { ITweakedTransactionData } from '../shared/TweakedTransaction.js';
|
|
4
|
-
import { VaultUTXOs } from '../processor/PsbtTransaction.js';
|
|
5
3
|
import { ChainId } from '../../network/ChainId.js';
|
|
6
|
-
import { Address } from '../../keypair/Address.js';
|
|
7
4
|
import { PsbtOutputExtended } from '@btc-vision/bitcoin';
|
|
8
5
|
export interface ITransactionParameters extends ITweakedTransactionData {
|
|
9
6
|
readonly from?: string;
|
|
@@ -29,17 +26,6 @@ export interface IInteractionParameters extends Omit<SharedInteractionParameters
|
|
|
29
26
|
readonly calldata: Buffer;
|
|
30
27
|
readonly to: string;
|
|
31
28
|
}
|
|
32
|
-
export interface IWrapParameters extends Omit<SharedInteractionParameters, 'optionalOutputs'> {
|
|
33
|
-
readonly to?: string;
|
|
34
|
-
readonly from: string;
|
|
35
|
-
readonly amount: bigint;
|
|
36
|
-
readonly receiver?: Address;
|
|
37
|
-
readonly generationParameters: WrappedGeneration;
|
|
38
|
-
}
|
|
39
|
-
export interface IUnwrapParameters extends Omit<SharedInteractionParameters, 'optionalOutputs'> {
|
|
40
|
-
readonly unwrapUTXOs: VaultUTXOs[];
|
|
41
|
-
readonly amount: bigint;
|
|
42
|
-
}
|
|
43
29
|
export interface IDeploymentParameters extends Omit<ITransactionParameters, 'to'> {
|
|
44
30
|
readonly bytecode: Buffer;
|
|
45
31
|
readonly calldata?: Buffer;
|
|
@@ -5,20 +5,6 @@ export interface PsbtTransactionData extends ITweakedTransactionData {
|
|
|
5
5
|
readonly signer: Signer;
|
|
6
6
|
readonly network: Network;
|
|
7
7
|
}
|
|
8
|
-
export interface IWBTCUTXODocument {
|
|
9
|
-
readonly vault: string;
|
|
10
|
-
readonly blockId: bigint;
|
|
11
|
-
readonly hash: string;
|
|
12
|
-
readonly value: bigint;
|
|
13
|
-
readonly outputIndex: number;
|
|
14
|
-
readonly output: string;
|
|
15
|
-
}
|
|
16
|
-
export interface VaultUTXOs {
|
|
17
|
-
readonly vault: string;
|
|
18
|
-
readonly publicKeys: string[];
|
|
19
|
-
readonly minimum: number;
|
|
20
|
-
readonly utxos: IWBTCUTXODocument[];
|
|
21
|
-
}
|
|
22
8
|
export type FromBase64Params = Omit<PsbtTransactionData, 'psbt'>;
|
|
23
9
|
export declare class PsbtTransaction extends TweakedTransaction {
|
|
24
10
|
readonly logColor: string;
|
|
@@ -36,5 +22,4 @@ export declare class PsbtTransaction extends TweakedTransaction {
|
|
|
36
22
|
addOutput(output: PsbtOutputExtended): void;
|
|
37
23
|
attemptFinalizeInputs(n?: number): boolean;
|
|
38
24
|
getPSBT(): Psbt;
|
|
39
|
-
private getTotalOutputAmount;
|
|
40
25
|
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { VaultUTXOs } from '../transaction/processor/PsbtTransaction.js';
|
|
2
1
|
export declare class BitcoinUtils {
|
|
3
2
|
static btcToSatoshi(btc: number): bigint;
|
|
4
3
|
static rndBytes(): Buffer;
|
|
5
4
|
static getUnsafeRandomValues(length: number): Buffer;
|
|
6
5
|
static opnetHash(data: Buffer): string;
|
|
7
|
-
static orderVaultsByAddress(vaults: VaultUTXOs[]): VaultUTXOs[];
|
|
8
|
-
static findVaultWithMostPublicKeys(vaults: VaultUTXOs[]): VaultUTXOs;
|
|
9
6
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Network } from '@btc-vision/bitcoin';
|
|
2
|
-
import {
|
|
3
|
-
import { UnwrapGeneration } from '../wbtc/UnwrapGeneration.js';
|
|
4
|
-
import { WrappedGeneration } from '../wbtc/WrappedGenerationParameters.js';
|
|
2
|
+
import { Wallet } from '../opnet.js';
|
|
5
3
|
import { BroadcastResponse } from './interfaces/BroadcastResponse.js';
|
|
6
4
|
import { FetchUTXOParams, FetchUTXOParamsMultiAddress, RawUTXOResponse, UTXO } from './interfaces/IUTXO.js';
|
|
7
5
|
export interface WalletUTXOs {
|
|
@@ -21,6 +19,4 @@ export declare class OPNetLimitedProvider {
|
|
|
21
19
|
error: string;
|
|
22
20
|
}>;
|
|
23
21
|
rpcMethod(method: string, paramsMethod: unknown[]): Promise<unknown>;
|
|
24
|
-
fetchWrapParameters(amount: bigint): Promise<WrappedGeneration | undefined>;
|
|
25
|
-
fetchUnWrapParameters(amount: bigint, receiver: Address): Promise<UnwrapGeneration | undefined>;
|
|
26
22
|
}
|
package/build/_version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.0
|
|
1
|
+
export declare const version = "1.1.0";
|
package/build/_version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.0
|
|
1
|
+
export const version = '1.1.0';
|
|
@@ -3,10 +3,6 @@ export interface ConsensusConfig<T extends Consensus> {
|
|
|
3
3
|
readonly CONSENSUS: T;
|
|
4
4
|
readonly CONSENSUS_NAME: string;
|
|
5
5
|
readonly ENABLED_AT_BLOCK: bigint;
|
|
6
|
-
readonly VAULT_MINIMUM_AMOUNT: bigint;
|
|
7
|
-
readonly VAULT_NETWORK_CONSOLIDATION_ACCEPTANCE: bigint;
|
|
8
|
-
readonly UNWRAP_CONSOLIDATION_PREPAID_FEES: bigint;
|
|
9
|
-
readonly UNWRAP_CONSOLIDATION_PREPAID_FEES_SAT: bigint;
|
|
10
6
|
}
|
|
11
7
|
export declare const OPNetConsensusConfig: {
|
|
12
8
|
[key in Consensus]?: ConsensusConfig<key>;
|
|
@@ -3,8 +3,4 @@ export const RoswellConsensus = {
|
|
|
3
3
|
CONSENSUS: Consensus.Roswell,
|
|
4
4
|
CONSENSUS_NAME: 'Roswell',
|
|
5
5
|
ENABLED_AT_BLOCK: 0n,
|
|
6
|
-
VAULT_MINIMUM_AMOUNT: 200000n,
|
|
7
|
-
VAULT_NETWORK_CONSOLIDATION_ACCEPTANCE: 200000n * 2n,
|
|
8
|
-
UNWRAP_CONSOLIDATION_PREPAID_FEES: 250n,
|
|
9
|
-
UNWRAP_CONSOLIDATION_PREPAID_FEES_SAT: 56500n,
|
|
10
6
|
};
|
package/build/opnet.d.ts
CHANGED
|
@@ -13,7 +13,6 @@ export * from './keypair/EcKeyPair.js';
|
|
|
13
13
|
export * from './keypair/Wallet.js';
|
|
14
14
|
export * from './keypair/interfaces/IWallet.js';
|
|
15
15
|
export * from './keypair/AddressVerificator.js';
|
|
16
|
-
export * from './metadata/contracts/wBTC.js';
|
|
17
16
|
export * from './metadata/ContractBaseMetadata.js';
|
|
18
17
|
export * from './signer/TweakedSigner.js';
|
|
19
18
|
export * from './transaction/TransactionFactory.js';
|
|
@@ -23,14 +22,10 @@ export * from './transaction/enums/TransactionType.js';
|
|
|
23
22
|
export * from './transaction/builders/InteractionTransaction.js';
|
|
24
23
|
export * from './transaction/builders/FundingTransaction.js';
|
|
25
24
|
export * from './transaction/builders/TransactionBuilder.js';
|
|
26
|
-
export * from './transaction/builders/WrapTransaction.js';
|
|
27
25
|
export * from './transaction/builders/SharedInteractionTransaction.js';
|
|
28
26
|
export * from './transaction/builders/DeploymentTransaction.js';
|
|
29
|
-
export * from './transaction/builders/UnwrapTransaction.js';
|
|
30
27
|
export * from './transaction/builders/CustomScriptTransaction.js';
|
|
31
28
|
export * from './transaction/builders/MultiSignTransaction.js';
|
|
32
|
-
export * from './wbtc/WrappedGenerationParameters.js';
|
|
33
|
-
export * from './wbtc/Generate.js';
|
|
34
29
|
export * from './network/ChainId.js';
|
|
35
30
|
export * from './utils/BitcoinUtils.js';
|
|
36
31
|
export * from './utxo/interfaces/IUTXO.js';
|
|
@@ -40,7 +35,6 @@ export * from './transaction/shared/TweakedTransaction.js';
|
|
|
40
35
|
export * from './utxo/interfaces/BroadcastResponse.js';
|
|
41
36
|
export * from './transaction/psbt/PSBTTypes.js';
|
|
42
37
|
export * from './transaction/shared/P2TR_MS.js';
|
|
43
|
-
export * from './wbtc/UnwrapGeneration.js';
|
|
44
38
|
export * from './consensus/ConsensusConfig.js';
|
|
45
39
|
export * from './consensus/Consensus.js';
|
|
46
40
|
export * from './consensus/metadata/RoswellConsensus.js';
|
package/build/opnet.js
CHANGED
|
@@ -13,7 +13,6 @@ export * from './keypair/EcKeyPair.js';
|
|
|
13
13
|
export * from './keypair/Wallet.js';
|
|
14
14
|
export * from './keypair/interfaces/IWallet.js';
|
|
15
15
|
export * from './keypair/AddressVerificator.js';
|
|
16
|
-
export * from './metadata/contracts/wBTC.js';
|
|
17
16
|
export * from './metadata/ContractBaseMetadata.js';
|
|
18
17
|
export * from './signer/TweakedSigner.js';
|
|
19
18
|
export * from './transaction/TransactionFactory.js';
|
|
@@ -23,14 +22,10 @@ export * from './transaction/enums/TransactionType.js';
|
|
|
23
22
|
export * from './transaction/builders/InteractionTransaction.js';
|
|
24
23
|
export * from './transaction/builders/FundingTransaction.js';
|
|
25
24
|
export * from './transaction/builders/TransactionBuilder.js';
|
|
26
|
-
export * from './transaction/builders/WrapTransaction.js';
|
|
27
25
|
export * from './transaction/builders/SharedInteractionTransaction.js';
|
|
28
26
|
export * from './transaction/builders/DeploymentTransaction.js';
|
|
29
|
-
export * from './transaction/builders/UnwrapTransaction.js';
|
|
30
27
|
export * from './transaction/builders/CustomScriptTransaction.js';
|
|
31
28
|
export * from './transaction/builders/MultiSignTransaction.js';
|
|
32
|
-
export * from './wbtc/WrappedGenerationParameters.js';
|
|
33
|
-
export * from './wbtc/Generate.js';
|
|
34
29
|
export * from './network/ChainId.js';
|
|
35
30
|
export * from './utils/BitcoinUtils.js';
|
|
36
31
|
export * from './utxo/interfaces/IUTXO.js';
|
|
@@ -40,7 +35,6 @@ export * from './transaction/shared/TweakedTransaction.js';
|
|
|
40
35
|
export * from './utxo/interfaces/BroadcastResponse.js';
|
|
41
36
|
export * from './transaction/psbt/PSBTTypes.js';
|
|
42
37
|
export * from './transaction/shared/P2TR_MS.js';
|
|
43
|
-
export * from './wbtc/UnwrapGeneration.js';
|
|
44
38
|
export * from './consensus/ConsensusConfig.js';
|
|
45
39
|
export * from './consensus/Consensus.js';
|
|
46
40
|
export * from './consensus/metadata/RoswellConsensus.js';
|
|
@@ -4,7 +4,7 @@ import { ICustomTransactionParameters } from './builders/CustomScriptTransaction
|
|
|
4
4
|
import { FundingTransaction } from './builders/FundingTransaction.js';
|
|
5
5
|
import { TransactionBuilder } from './builders/TransactionBuilder.js';
|
|
6
6
|
import { TransactionType } from './enums/TransactionType.js';
|
|
7
|
-
import { IDeploymentParameters, IFundingTransactionParameters, IInteractionParameters
|
|
7
|
+
import { IDeploymentParameters, IFundingTransactionParameters, IInteractionParameters } from './interfaces/ITransactionParameters.js';
|
|
8
8
|
export interface DeploymentResult {
|
|
9
9
|
readonly transaction: [string, string];
|
|
10
10
|
readonly contractAddress: string;
|
|
@@ -31,25 +31,13 @@ export interface BitcoinTransferResponse {
|
|
|
31
31
|
readonly estimatedFees: bigint;
|
|
32
32
|
readonly nextUTXOs: UTXO[];
|
|
33
33
|
}
|
|
34
|
-
export interface UnwrapResult {
|
|
35
|
-
readonly fundingTransaction: string;
|
|
36
|
-
readonly psbt: string;
|
|
37
|
-
readonly feeRefundOrLoss: bigint;
|
|
38
|
-
readonly utxos: UTXO[];
|
|
39
|
-
}
|
|
40
34
|
export declare class TransactionFactory {
|
|
41
35
|
createCustomScriptTransaction(interactionParameters: ICustomTransactionParameters): Promise<[string, string, UTXO[]]>;
|
|
42
36
|
signInteraction(interactionParameters: IInteractionParameters): Promise<[string, string, UTXO[]]>;
|
|
43
37
|
signDeployment(deploymentParameters: IDeploymentParameters): Promise<DeploymentResult>;
|
|
44
|
-
wrap(wrapParameters: Omit<IWrapParameters, 'calldata'>): Promise<WrapResult>;
|
|
45
|
-
unwrapSegwit(unwrapParameters: IUnwrapParameters): Promise<UnwrapResult>;
|
|
46
|
-
unwrap(unwrapParameters: IUnwrapParameters): Promise<UnwrapResult>;
|
|
47
38
|
createBTCTransfer(parameters: IFundingTransactionParameters): Promise<BitcoinTransferResponse>;
|
|
48
39
|
getAllNewUTXOs(original: TransactionBuilder<TransactionType>, tx: Transaction, to: string): UTXO[];
|
|
49
40
|
private createFundTransaction;
|
|
50
|
-
private calculateNumSignatures;
|
|
51
|
-
private calculateNumInputs;
|
|
52
|
-
private maxPubKeySize;
|
|
53
41
|
private writePSBTHeader;
|
|
54
42
|
private getPriorityFee;
|
|
55
43
|
private getUTXOAsTransaction;
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import { currentConsensus
|
|
2
|
-
import { wBTC } from '../metadata/contracts/wBTC.js';
|
|
1
|
+
import { currentConsensus } from '../consensus/ConsensusConfig.js';
|
|
3
2
|
import { CustomScriptTransaction, } from './builders/CustomScriptTransaction.js';
|
|
4
3
|
import { DeploymentTransaction } from './builders/DeploymentTransaction.js';
|
|
5
4
|
import { FundingTransaction } from './builders/FundingTransaction.js';
|
|
6
5
|
import { InteractionTransaction } from './builders/InteractionTransaction.js';
|
|
7
6
|
import { TransactionBuilder } from './builders/TransactionBuilder.js';
|
|
8
|
-
import { UnwrapSegwitTransaction } from './builders/UnwrapSegwitTransaction.js';
|
|
9
|
-
import { UnwrapTransaction } from './builders/UnwrapTransaction.js';
|
|
10
|
-
import { WrapTransaction } from './builders/WrapTransaction.js';
|
|
11
|
-
import { PSBTTypes } from './psbt/PSBTTypes.js';
|
|
12
7
|
export class TransactionFactory {
|
|
13
8
|
async createCustomScriptTransaction(interactionParameters) {
|
|
14
9
|
if (!interactionParameters.to) {
|
|
@@ -143,140 +138,6 @@ export class TransactionFactory {
|
|
|
143
138
|
utxos: [refundUTXO],
|
|
144
139
|
};
|
|
145
140
|
}
|
|
146
|
-
async wrap(wrapParameters) {
|
|
147
|
-
if (wrapParameters.amount < currentConsensusConfig.VAULT_MINIMUM_AMOUNT) {
|
|
148
|
-
throw new Error(`Amount is too low. Minimum consolidation is ${currentConsensusConfig.VAULT_MINIMUM_AMOUNT} sat. Received ${wrapParameters.amount} sat. Make sure that you cover the unwrap consolidation fees of ${currentConsensusConfig.UNWRAP_CONSOLIDATION_PREPAID_FEES_SAT}sat.`);
|
|
149
|
-
}
|
|
150
|
-
const childTransactionRequiredValue = wrapParameters.amount +
|
|
151
|
-
currentConsensusConfig.UNWRAP_CONSOLIDATION_PREPAID_FEES_SAT +
|
|
152
|
-
this.getPriorityFee(wrapParameters);
|
|
153
|
-
const wbtc = new wBTC(wrapParameters.network, wrapParameters.chainId);
|
|
154
|
-
const to = wbtc.getAddress();
|
|
155
|
-
const fundingParameters = {
|
|
156
|
-
...wrapParameters,
|
|
157
|
-
amount: childTransactionRequiredValue,
|
|
158
|
-
to: wrapParameters.to ?? to,
|
|
159
|
-
};
|
|
160
|
-
const preFundingTransaction = await this.createFundTransaction(fundingParameters);
|
|
161
|
-
wrapParameters.utxos = this.getUTXOAsTransaction(preFundingTransaction.tx, to, 0);
|
|
162
|
-
const preTransaction = new WrapTransaction(wrapParameters);
|
|
163
|
-
await preTransaction.signTransaction();
|
|
164
|
-
const parameters = await preTransaction.getFundingTransactionParameters();
|
|
165
|
-
parameters.amount += childTransactionRequiredValue;
|
|
166
|
-
parameters.utxos = fundingParameters.utxos;
|
|
167
|
-
const signedTransaction = await this.createFundTransaction(parameters);
|
|
168
|
-
if (!signedTransaction) {
|
|
169
|
-
throw new Error('Could not sign funding transaction.');
|
|
170
|
-
}
|
|
171
|
-
const newParams = {
|
|
172
|
-
...wrapParameters,
|
|
173
|
-
utxos: this.getUTXOAsTransaction(signedTransaction.tx, to, 0),
|
|
174
|
-
randomBytes: preTransaction.getRndBytes(),
|
|
175
|
-
nonWitnessUtxo: signedTransaction.tx.toBuffer(),
|
|
176
|
-
};
|
|
177
|
-
const finalTransaction = new WrapTransaction(newParams);
|
|
178
|
-
const outTx = await finalTransaction.signTransaction();
|
|
179
|
-
return {
|
|
180
|
-
transaction: [signedTransaction.tx.toHex(), outTx.toHex()],
|
|
181
|
-
vaultAddress: finalTransaction.vault,
|
|
182
|
-
amount: finalTransaction.amount,
|
|
183
|
-
receiverAddress: finalTransaction.receiver.p2tr(wrapParameters.network),
|
|
184
|
-
utxos: this.getUTXOAsTransaction(signedTransaction.tx, wrapParameters.from, 1),
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
async unwrapSegwit(unwrapParameters) {
|
|
188
|
-
console.error('The "unwrap" method is deprecated. Use unwrapTap instead.');
|
|
189
|
-
const transaction = new UnwrapSegwitTransaction(unwrapParameters);
|
|
190
|
-
await transaction.signTransaction();
|
|
191
|
-
const to = transaction.toAddress();
|
|
192
|
-
if (!to)
|
|
193
|
-
throw new Error('To address is required');
|
|
194
|
-
const estimatedGas = await transaction.estimateTransactionFees();
|
|
195
|
-
const estimatedFees = transaction.preEstimateTransactionFees(BigInt(unwrapParameters.feeRate), this.calculateNumInputs(unwrapParameters.unwrapUTXOs), 2n, this.calculateNumSignatures(unwrapParameters.unwrapUTXOs), this.maxPubKeySize(unwrapParameters.unwrapUTXOs));
|
|
196
|
-
const fundingParameters = {
|
|
197
|
-
...unwrapParameters,
|
|
198
|
-
amount: estimatedGas + estimatedFees,
|
|
199
|
-
to: to,
|
|
200
|
-
};
|
|
201
|
-
const preFundingTransaction = await this.createFundTransaction(fundingParameters);
|
|
202
|
-
unwrapParameters.utxos = this.getUTXOAsTransaction(preFundingTransaction.tx, to, 0);
|
|
203
|
-
const preTransaction = new UnwrapSegwitTransaction({
|
|
204
|
-
...unwrapParameters,
|
|
205
|
-
randomBytes: transaction.getRndBytes(),
|
|
206
|
-
});
|
|
207
|
-
await preTransaction.signTransaction();
|
|
208
|
-
const parameters = await preTransaction.getFundingTransactionParameters();
|
|
209
|
-
parameters.utxos = fundingParameters.utxos;
|
|
210
|
-
parameters.amount = (await preTransaction.estimateTransactionFees()) + estimatedFees;
|
|
211
|
-
const signedTransaction = await this.createFundTransaction(parameters);
|
|
212
|
-
if (!signedTransaction) {
|
|
213
|
-
throw new Error('Could not sign funding transaction.');
|
|
214
|
-
}
|
|
215
|
-
const newParams = {
|
|
216
|
-
...unwrapParameters,
|
|
217
|
-
utxos: this.getUTXOAsTransaction(signedTransaction.tx, to, 0),
|
|
218
|
-
randomBytes: preTransaction.getRndBytes(),
|
|
219
|
-
nonWitnessUtxo: signedTransaction.tx.toBuffer(),
|
|
220
|
-
};
|
|
221
|
-
const finalTransaction = new UnwrapSegwitTransaction(newParams);
|
|
222
|
-
const outTx = await finalTransaction.signPSBT();
|
|
223
|
-
const asBase64 = outTx.toBase64();
|
|
224
|
-
const psbt = this.writePSBTHeader(PSBTTypes.UNWRAP, asBase64);
|
|
225
|
-
return {
|
|
226
|
-
fundingTransaction: signedTransaction.tx.toHex(),
|
|
227
|
-
psbt: psbt,
|
|
228
|
-
feeRefundOrLoss: estimatedFees,
|
|
229
|
-
utxos: [],
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
async unwrap(unwrapParameters) {
|
|
233
|
-
if (!unwrapParameters.from) {
|
|
234
|
-
throw new Error('Field "from" not provided.');
|
|
235
|
-
}
|
|
236
|
-
const transaction = new UnwrapTransaction(unwrapParameters);
|
|
237
|
-
await transaction.signTransaction();
|
|
238
|
-
const to = transaction.toAddress();
|
|
239
|
-
if (!to)
|
|
240
|
-
throw new Error('To address is required');
|
|
241
|
-
const estimatedGas = await transaction.estimateTransactionFees();
|
|
242
|
-
const fundingParameters = {
|
|
243
|
-
...unwrapParameters,
|
|
244
|
-
amount: estimatedGas,
|
|
245
|
-
to: to,
|
|
246
|
-
};
|
|
247
|
-
const preFundingTransaction = await this.createFundTransaction(fundingParameters);
|
|
248
|
-
unwrapParameters.utxos = this.getUTXOAsTransaction(preFundingTransaction.tx, to, 0);
|
|
249
|
-
const preTransaction = new UnwrapTransaction({
|
|
250
|
-
...unwrapParameters,
|
|
251
|
-
randomBytes: transaction.getRndBytes(),
|
|
252
|
-
});
|
|
253
|
-
await preTransaction.signTransaction();
|
|
254
|
-
const parameters = await preTransaction.getFundingTransactionParameters();
|
|
255
|
-
parameters.utxos = fundingParameters.utxos;
|
|
256
|
-
parameters.amount =
|
|
257
|
-
(await preTransaction.estimateTransactionFees()) +
|
|
258
|
-
this.getPriorityFee(unwrapParameters);
|
|
259
|
-
const signedTransaction = await this.createFundTransaction(parameters);
|
|
260
|
-
if (!signedTransaction) {
|
|
261
|
-
throw new Error('Could not sign funding transaction.');
|
|
262
|
-
}
|
|
263
|
-
const newParams = {
|
|
264
|
-
...unwrapParameters,
|
|
265
|
-
utxos: this.getUTXOAsTransaction(signedTransaction.tx, to, 0),
|
|
266
|
-
randomBytes: preTransaction.getRndBytes(),
|
|
267
|
-
nonWitnessUtxo: signedTransaction.tx.toBuffer(),
|
|
268
|
-
};
|
|
269
|
-
const finalTransaction = new UnwrapTransaction(newParams);
|
|
270
|
-
const outTx = await finalTransaction.signPSBT();
|
|
271
|
-
const asBase64 = outTx.toBase64();
|
|
272
|
-
const psbt = this.writePSBTHeader(PSBTTypes.UNWRAP, asBase64);
|
|
273
|
-
return {
|
|
274
|
-
fundingTransaction: signedTransaction.tx.toHex(),
|
|
275
|
-
psbt: psbt,
|
|
276
|
-
feeRefundOrLoss: finalTransaction.getFeeLossOrRefund(),
|
|
277
|
-
utxos: this.getUTXOAsTransaction(signedTransaction.tx, unwrapParameters.from, 1),
|
|
278
|
-
};
|
|
279
|
-
}
|
|
280
141
|
async createBTCTransfer(parameters) {
|
|
281
142
|
if (!parameters.from) {
|
|
282
143
|
throw new Error('Field "from" not provided.');
|
|
@@ -320,27 +181,6 @@ export class TransactionFactory {
|
|
|
320
181
|
nextUTXOs: this.getUTXOAsTransaction(signedTransaction, parameters.to, 0),
|
|
321
182
|
};
|
|
322
183
|
}
|
|
323
|
-
calculateNumSignatures(vault) {
|
|
324
|
-
let numSignatures = 0n;
|
|
325
|
-
for (const v of vault) {
|
|
326
|
-
numSignatures += BigInt(v.minimum * v.utxos.length);
|
|
327
|
-
}
|
|
328
|
-
return numSignatures;
|
|
329
|
-
}
|
|
330
|
-
calculateNumInputs(vault) {
|
|
331
|
-
let numSignatures = 0n;
|
|
332
|
-
for (const v of vault) {
|
|
333
|
-
numSignatures += BigInt(v.utxos.length);
|
|
334
|
-
}
|
|
335
|
-
return numSignatures;
|
|
336
|
-
}
|
|
337
|
-
maxPubKeySize(vault) {
|
|
338
|
-
let size = 0;
|
|
339
|
-
for (const v of vault) {
|
|
340
|
-
size = Math.max(size, v.publicKeys.length);
|
|
341
|
-
}
|
|
342
|
-
return BigInt(size);
|
|
343
|
-
}
|
|
344
184
|
writePSBTHeader(type, psbt) {
|
|
345
185
|
const buf = Buffer.from(psbt, 'base64');
|
|
346
186
|
const header = Buffer.alloc(2);
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { IDeploymentParameters, IInteractionParameters
|
|
1
|
+
import { IDeploymentParameters, IInteractionParameters } from '../interfaces/ITransactionParameters.js';
|
|
2
2
|
import { UTXO } from '../../utxo/interfaces/IUTXO.js';
|
|
3
|
-
import { DeploymentResult
|
|
3
|
+
import { DeploymentResult } from '../TransactionFactory';
|
|
4
4
|
export type InteractionParametersWithoutSigner = Omit<IInteractionParameters, 'signer'>;
|
|
5
|
-
export type IWrapParametersWithoutSigner = Omit<IWrapParameters, 'signer'>;
|
|
6
|
-
export type IUnwrapParametersWithoutSigner = Omit<IUnwrapParameters, 'signer'>;
|
|
7
5
|
export type IDeploymentParametersWithoutSigner = Omit<IDeploymentParameters, 'signer' | 'network'>;
|
|
8
6
|
export interface BroadcastTransactionOptions {
|
|
9
7
|
raw: string;
|
|
@@ -21,6 +19,4 @@ export interface Web3Provider {
|
|
|
21
19
|
signAndBroadcastInteraction(interactionParameters: InteractionParametersWithoutSigner): Promise<[BroadcastedTransaction, BroadcastedTransaction, UTXO[]]>;
|
|
22
20
|
deployContract(params: IDeploymentParametersWithoutSigner): Promise<DeploymentResult>;
|
|
23
21
|
broadcast(transactions: BroadcastTransactionOptions[]): Promise<BroadcastedTransaction[]>;
|
|
24
|
-
wrap(wrapParameters: IWrapParametersWithoutSigner): Promise<WrapResult>;
|
|
25
|
-
unwrap(unwrapParameters: IUnwrapParametersWithoutSigner): Promise<UnwrapResult>;
|
|
26
22
|
}
|
|
@@ -28,7 +28,10 @@ export declare class UnisatSigner extends CustomKeypair {
|
|
|
28
28
|
verify(hash: Buffer, signature: Buffer): boolean;
|
|
29
29
|
signTaprootInput(transaction: Psbt, i: number, sighashTypes: number[]): Promise<void>;
|
|
30
30
|
signInput(transaction: Psbt, i: number, sighashTypes: number[]): Promise<void>;
|
|
31
|
+
private hasAlreadySignedTapScriptSig;
|
|
32
|
+
private hasAlreadyPartialSig;
|
|
31
33
|
private combine;
|
|
34
|
+
private signAllTweaked;
|
|
32
35
|
private signTweaked;
|
|
33
36
|
private getNonDuplicateScriptSig;
|
|
34
37
|
}
|
|
@@ -88,12 +88,54 @@ export class UnisatSigner extends CustomKeypair {
|
|
|
88
88
|
throw new Error('Not implemented: verify');
|
|
89
89
|
}
|
|
90
90
|
async signTaprootInput(transaction, i, sighashTypes) {
|
|
91
|
-
const
|
|
91
|
+
const input = transaction.data.inputs[i];
|
|
92
|
+
if (input.tapKeySig ||
|
|
93
|
+
input.finalScriptSig ||
|
|
94
|
+
(Array.isArray(input.partialSig) &&
|
|
95
|
+
input.partialSig.length &&
|
|
96
|
+
this.hasAlreadyPartialSig(input.partialSig)) ||
|
|
97
|
+
(Array.isArray(input.tapScriptSig) &&
|
|
98
|
+
input.tapScriptSig.length &&
|
|
99
|
+
this.hasAlreadySignedTapScriptSig(input.tapScriptSig))) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
const firstSignature = await this.signAllTweaked(transaction, sighashTypes, false);
|
|
92
103
|
this.combine(transaction, firstSignature, i);
|
|
93
104
|
}
|
|
94
105
|
async signInput(transaction, i, sighashTypes) {
|
|
95
|
-
const
|
|
96
|
-
|
|
106
|
+
const input = transaction.data.inputs[i];
|
|
107
|
+
if (input.tapKeySig ||
|
|
108
|
+
input.finalScriptSig ||
|
|
109
|
+
(Array.isArray(input.partialSig) &&
|
|
110
|
+
input.partialSig.length &&
|
|
111
|
+
this.hasAlreadyPartialSig(input.partialSig)) ||
|
|
112
|
+
(Array.isArray(input.tapScriptSig) &&
|
|
113
|
+
input.tapScriptSig.length &&
|
|
114
|
+
this.hasAlreadySignedTapScriptSig(input.tapScriptSig))) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
const firstSignature = await this.signAllTweaked(transaction, sighashTypes, true);
|
|
118
|
+
this.combine(transaction, firstSignature, i);
|
|
119
|
+
}
|
|
120
|
+
hasAlreadySignedTapScriptSig(input) {
|
|
121
|
+
for (let i = 0; i < input.length; i++) {
|
|
122
|
+
const item = input[i];
|
|
123
|
+
const buf = Buffer.from(item.pubkey);
|
|
124
|
+
if (buf.equals(this.publicKey) && item.signature) {
|
|
125
|
+
return true;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
hasAlreadyPartialSig(input) {
|
|
131
|
+
for (let i = 0; i < input.length; i++) {
|
|
132
|
+
const item = input[i];
|
|
133
|
+
const buf = Buffer.from(item.pubkey);
|
|
134
|
+
if (buf.equals(this.publicKey) && item.signature) {
|
|
135
|
+
return true;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return false;
|
|
97
139
|
}
|
|
98
140
|
combine(transaction, newPsbt, i) {
|
|
99
141
|
const signedInput = newPsbt.data.inputs[i];
|
|
@@ -117,6 +159,26 @@ export class UnisatSigner extends CustomKeypair {
|
|
|
117
159
|
}
|
|
118
160
|
}
|
|
119
161
|
}
|
|
162
|
+
async signAllTweaked(transaction, sighashTypes, disableTweakSigner = false) {
|
|
163
|
+
const pubKey = this.publicKey.toString('hex');
|
|
164
|
+
const toSign = transaction.data.inputs.map((_, i) => {
|
|
165
|
+
return [
|
|
166
|
+
{
|
|
167
|
+
index: i,
|
|
168
|
+
publicKey: pubKey,
|
|
169
|
+
sighashTypes,
|
|
170
|
+
disableTweakSigner: disableTweakSigner,
|
|
171
|
+
},
|
|
172
|
+
];
|
|
173
|
+
});
|
|
174
|
+
const opts = {
|
|
175
|
+
autoFinalized: false,
|
|
176
|
+
toSignInputs: toSign.flat(),
|
|
177
|
+
};
|
|
178
|
+
const psbt = transaction.toHex();
|
|
179
|
+
const signed = await this.unisat.signPsbt(psbt, opts);
|
|
180
|
+
return Psbt.fromHex(signed);
|
|
181
|
+
}
|
|
120
182
|
async signTweaked(transaction, i, sighashTypes, disableTweakSigner = false) {
|
|
121
183
|
const opts = {
|
|
122
184
|
autoFinalized: false,
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { UTXO } from '../../utxo/interfaces/IUTXO.js';
|
|
2
|
-
import { WrappedGeneration } from '../../wbtc/WrappedGenerationParameters.js';
|
|
3
2
|
import { ITweakedTransactionData } from '../shared/TweakedTransaction.js';
|
|
4
|
-
import { VaultUTXOs } from '../processor/PsbtTransaction.js';
|
|
5
3
|
import { ChainId } from '../../network/ChainId.js';
|
|
6
|
-
import { Address } from '../../keypair/Address.js';
|
|
7
4
|
import { PsbtOutputExtended } from '@btc-vision/bitcoin';
|
|
8
5
|
export interface ITransactionParameters extends ITweakedTransactionData {
|
|
9
6
|
readonly from?: string;
|
|
@@ -29,17 +26,6 @@ export interface IInteractionParameters extends Omit<SharedInteractionParameters
|
|
|
29
26
|
readonly calldata: Buffer;
|
|
30
27
|
readonly to: string;
|
|
31
28
|
}
|
|
32
|
-
export interface IWrapParameters extends Omit<SharedInteractionParameters, 'optionalOutputs'> {
|
|
33
|
-
readonly to?: string;
|
|
34
|
-
readonly from: string;
|
|
35
|
-
readonly amount: bigint;
|
|
36
|
-
readonly receiver?: Address;
|
|
37
|
-
readonly generationParameters: WrappedGeneration;
|
|
38
|
-
}
|
|
39
|
-
export interface IUnwrapParameters extends Omit<SharedInteractionParameters, 'optionalOutputs'> {
|
|
40
|
-
readonly unwrapUTXOs: VaultUTXOs[];
|
|
41
|
-
readonly amount: bigint;
|
|
42
|
-
}
|
|
43
29
|
export interface IDeploymentParameters extends Omit<ITransactionParameters, 'to'> {
|
|
44
30
|
readonly bytecode: Buffer;
|
|
45
31
|
readonly calldata?: Buffer;
|