@@ -29,6 +29,7 @@ import (
2929 "github.com/lightninglabs/taproot-assets/tapgarden"
3030 "github.com/lightninglabs/taproot-assets/tappsbt"
3131 "github.com/lightninglabs/taproot-assets/tapscript"
32+ "github.com/lightninglabs/taproot-assets/tapsend"
3233 "github.com/lightningnetwork/lnd/keychain"
3334 "github.com/lightningnetwork/lnd/lnwallet/chainfee"
3435)
@@ -106,13 +107,13 @@ type Wallet interface {
106107 // FundPacket funds a virtual transaction, selecting assets to spend
107108 // in order to pay the given recipient. The selected input is then added
108109 // to the given virtual transaction.
109- FundPacket (ctx context.Context , fundDesc * tapscript .FundingDescriptor ,
110+ FundPacket (ctx context.Context , fundDesc * tapsend .FundingDescriptor ,
110111 vPkt * tappsbt.VPacket ) (* FundedVPacket , error )
111112
112113 // FundBurn funds a virtual transaction for burning the given amount of
113114 // units of the given asset.
114115 FundBurn (ctx context.Context ,
115- fundDesc * tapscript .FundingDescriptor ) (* FundedVPacket , error )
116+ fundDesc * tapsend .FundingDescriptor ) (* FundedVPacket , error )
116117
117118 // SignVirtualPacket signs the virtual transaction of the given packet
118119 // and returns the input indexes that were signed.
@@ -441,7 +442,7 @@ func (f *AssetWallet) FundAddressSend(ctx context.Context,
441442 "transaction from addresses: %w" , err )
442443 }
443444
444- fundDesc , err := tapscript .DescribeAddrs (receiverAddrs )
445+ fundDesc , err := tapsend .DescribeAddrs (receiverAddrs )
445446 if err != nil {
446447 return nil , nil , fmt .Errorf ("unable to describe recipients: " +
447448 "%w" , err )
@@ -522,7 +523,7 @@ func (f *AssetWallet) passiveAssetVPacket(passiveAsset *asset.Asset,
522523// pay the given recipient. The selected input is then added to the given
523524// virtual transaction.
524525func (f * AssetWallet ) FundPacket (ctx context.Context ,
525- fundDesc * tapscript .FundingDescriptor ,
526+ fundDesc * tapsend .FundingDescriptor ,
526527 vPkt * tappsbt.VPacket ) (* FundedVPacket , error ) {
527528
528529 // The input and address networks must match.
@@ -551,7 +552,7 @@ func (f *AssetWallet) FundPacket(ctx context.Context,
551552// FundBurn funds a virtual transaction for burning the given amount of units of
552553// the given asset.
553554func (f * AssetWallet ) FundBurn (ctx context.Context ,
554- fundDesc * tapscript .FundingDescriptor ) (* FundedVPacket , error ) {
555+ fundDesc * tapsend .FundingDescriptor ) (* FundedVPacket , error ) {
555556
556557 // We need to find a commitment that has enough assets to satisfy this
557558 // send request. We'll map the address to a set of constraints, so we
@@ -702,7 +703,7 @@ func (f *AssetWallet) FundBurn(ctx context.Context,
702703
703704// fundPacketWithInputs funds a virtual transaction with the given inputs.
704705func (f * AssetWallet ) fundPacketWithInputs (ctx context.Context ,
705- fundDesc * tapscript .FundingDescriptor , vPkt * tappsbt.VPacket ,
706+ fundDesc * tapsend .FundingDescriptor , vPkt * tappsbt.VPacket ,
706707 selectedCommitments []* AnchoredCommitment ) (* FundedVPacket , error ) {
707708
708709 log .Infof ("Selected %v asset inputs for send of %d to %x" ,
@@ -746,7 +747,7 @@ func (f *AssetWallet) fundPacketWithInputs(ctx context.Context,
746747 },
747748 )
748749
749- fullValue , err := tapscript .ValidateInputs (
750+ fullValue , err := tapsend .ValidateInputs (
750751 inputCommitments , inputsScriptKeys , assetType , fundDesc ,
751752 )
752753 if err != nil {
@@ -914,7 +915,7 @@ func (f *AssetWallet) fundPacketWithInputs(ctx context.Context,
914915 )
915916 }
916917
917- if err := tapscript .PrepareOutputAssets (ctx , vPkt ); err != nil {
918+ if err := tapsend .PrepareOutputAssets (ctx , vPkt ); err != nil {
918919 return nil , fmt .Errorf ("unable to create split commit: %w" , err )
919920 }
920921
@@ -968,7 +969,7 @@ func (f *AssetWallet) setVPacketInputs(ctx context.Context,
968969 // to be in the commitment we spend (we did the same when
969970 // creating the output, so differences should be apparent when
970971 // debugging).
971- tapscript .LogCommitment (
972+ tapsend .LogCommitment (
972973 "Input" , idx , assetInput .Commitment , internalKey .PubKey ,
973974 anchorPkScript , anchorMerkleRoot [:],
974975 )
@@ -1106,7 +1107,7 @@ func (f *AssetWallet) SignVirtualPacket(vPkt *tappsbt.VPacket,
11061107 // Now we'll use the signer to sign all the inputs for the new Taproot
11071108 // Asset leaves. The witness data for each input will be assigned for
11081109 // us.
1109- err := tapscript .SignVirtualTransaction (
1110+ err := tapsend .SignVirtualTransaction (
11101111 vPkt , f .cfg .Signer , f .cfg .WitnessValidator ,
11111112 )
11121113 if err != nil {
@@ -1382,7 +1383,7 @@ func (f *AssetWallet) AnchorVirtualTransactions(ctx context.Context,
13821383 }
13831384 vPacket := params .VPkts [0 ]
13841385
1385- outputCommitments , err := tapscript .CreateOutputCommitments (
1386+ outputCommitments , err := tapsend .CreateOutputCommitments (
13861387 params .InputCommitments , vPacket , params .PassiveAssetsVPkts ,
13871388 )
13881389 if err != nil {
@@ -1392,7 +1393,7 @@ func (f *AssetWallet) AnchorVirtualTransactions(ctx context.Context,
13921393
13931394 // Construct our template PSBT to commits to the set of dummy locators
13941395 // we use to make fee estimation work.
1395- sendPacket , err := tapscript .CreateAnchorTx (vPacket .Outputs )
1396+ sendPacket , err := tapsend .CreateAnchorTx (vPacket .Outputs )
13961397 if err != nil {
13971398 return nil , fmt .Errorf ("error creating anchor TX: %w" , err )
13981399 }
@@ -1428,7 +1429,7 @@ func (f *AssetWallet) AnchorVirtualTransactions(ctx context.Context,
14281429
14291430 // First, we'll update the PSBT packets to insert the _real_ outputs we
14301431 // need to commit to the asset transfer.
1431- mergedCommitments , err := tapscript .UpdateTaprootOutputKeys (
1432+ mergedCommitments , err := tapsend .UpdateTaprootOutputKeys (
14321433 signAnchorPkt , vPacket , outputCommitments ,
14331434 )
14341435 if err != nil {
@@ -1508,7 +1509,7 @@ func (f *AssetWallet) SignOwnershipProof(
15081509 vPkt := tappsbt .OwnershipProofPacket (
15091510 ownedAsset .Copy (), f .cfg .ChainParams ,
15101511 )
1511- err := tapscript .SignVirtualTransaction (
1512+ err := tapsend .SignVirtualTransaction (
15121513 vPkt , f .cfg .Signer , f .cfg .WitnessValidator ,
15131514 )
15141515 if err != nil {
0 commit comments