This repository has been archived by the owner on Oct 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(BUX-156): add SubmitBatchTransactions
- Loading branch information
1 parent
0063bb2
commit 57471bd
Showing
7 changed files
with
208 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package arc_utils | ||
|
||
import ( | ||
"encoding/json" | ||
"io" | ||
|
||
"github.com/bitcoin-sv/go-broadcast-client/broadcast" | ||
) | ||
|
||
func DecodeArcError(body io.ReadCloser) error { | ||
resultError := broadcast.ArcError{} | ||
err := json.NewDecoder(body).Decode(&resultError) | ||
|
||
if err != nil { | ||
return broadcast.ErrUnableToDecodeResponse | ||
} | ||
|
||
return resultError | ||
} | ||
|
||
func DecodeResponseBody(body io.ReadCloser, resultOutput any) error { | ||
err := json.NewDecoder(body).Decode(resultOutput) | ||
if err != nil { | ||
return broadcast.ErrUnableToDecodeResponse | ||
} | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters