Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

fix(BUX-368): arc callback fixes #81

Merged
merged 2 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions broadcast/transaction_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ type TransactionOpts struct {
// and receive the transaction details and status.
func WithCallback(callbackURL string, callbackToken ...string) TransactionOptFunc {
return func(o *TransactionOpts) {
o.CallbackToken = callbackURL
o.CallbackURL = callbackURL
if len(callbackToken) > 0 {
o.CallbackToken = callbackToken[0]
}
}
}

// WithMerkleProof will return merkle proof from Arc.
func WithMerkleProof() TransactionOptFunc {
// WithMerkleProofFromCallback it's an option that indicates if the merkle proof should be returned in callback.
func WithMerkleProofFromCallback() TransactionOptFunc {
return func(o *TransactionOpts) {
o.MerkleProof = true
}
Expand Down
4 changes: 4 additions & 0 deletions broadcast/tx_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ const (
SeenOnNetwork TxStatus = "SEEN_ON_NETWORK" // 8
// Mined status means that transaction has been mined into a block by a mining node.
Mined TxStatus = "MINED" // 9
// SeenInOrphanMempool means that transaction has been sent to at least 1 Bitcoin node but parent transaction was not found.
SeenInOrphanMempool TxStatus = "SEEN_IN_ORPHAN_MEMPOOL" // 10
// Confirmed status means that transaction is marked as confirmed when it is in a block with 100 blocks built on top of that block.
Confirmed TxStatus = "CONFIRMED" // 108
// Rejected status means that transaction has been rejected by the Bitcoin network.
Expand Down Expand Up @@ -62,6 +64,8 @@ func MapTxStatusToInt(status TxStatus) (int, bool) {
value = 8
case Mined:
value = 9
case SeenInOrphanMempool:
value = 10
case Confirmed:
value = 108
case Rejected:
Expand Down
Loading