From f9a0c861fb4a0de7ca31bb1aff1b29afbd120406 Mon Sep 17 00:00:00 2001 From: Anh Minh <1phamminh0811@gmail.com> Date: Tue, 7 Oct 2025 22:24:54 +0700 Subject: [PATCH] fix send tx --- wallet/nockchain_service.go | 1 + wallet/service.go | 5 ++++- wallet/types.go | 10 +++++++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/wallet/nockchain_service.go b/wallet/nockchain_service.go index 7faf21f..dac0a74 100644 --- a/wallet/nockchain_service.go +++ b/wallet/nockchain_service.go @@ -126,6 +126,7 @@ func (nc *NockchainClient) WalletSendTransaction(tx *nockchain.RawTx) (*nockchai req := nockchain.WalletSendTransactionRequest{ TxId: ParseHash(tx.TxId), RawTx: &nockchain.RawTransaction{ + Id: ParseHash(tx.TxId), NamedInputs: inputs, TotalFees: &nockchain.Nicks{Value: tx.TotalFees}, TimelockRange: &nockchain.TimeLockRangeAbsolute{ diff --git a/wallet/service.go b/wallet/service.go index ebde3df..b3b2a3c 100644 --- a/wallet/service.go +++ b/wallet/service.go @@ -455,7 +455,10 @@ func (h *GprcHandler) CreateTx(ctx context.Context, req *nockchain.CreateTxReque var timelockRange *nockchain.TimelockRange if req.TimelockIntent == nil { - timelockRange = nil + timelockRange = &nockchain.TimelockRange{ + Min: nil, + Max: nil, + } } else { if req.TimelockIntent.Absolute != nil { timelockRange = req.TimelockIntent.Absolute diff --git a/wallet/types.go b/wallet/types.go index 38d12de..258578f 100644 --- a/wallet/types.go +++ b/wallet/types.go @@ -120,13 +120,17 @@ func ConvertInput(input *nockchain.NockchainInput) (*nockchain.NamedInput, error } pks = append(seedPks, pk) } - seeds = append(seeds, &nockchain.Seed{ - OutputSource: &nockchain.OutputSource{ + var source *nockchain.OutputSource + if seed.OutputSource != nil { + source = &nockchain.OutputSource{ Source: &nockchain.Source{ Hash: ParseHash(seed.OutputSource.Source), Coinbase: input.Note.Source.IsCoinbase, }, - }, + } + } + seeds = append(seeds, &nockchain.Seed{ + OutputSource: source, Recipient: &nockchain.Lock{ KeysRequired: uint32(seed.Recipient.KeysRequired), SchnorrPubkeys: seedPks,