github.com/algorand/go-algorand-sdk@v1.24.0/client/v2/algod/getTransactionProof.go (about) 1 package algod 2 3 import ( 4 "context" 5 "fmt" 6 7 "github.com/algorand/go-algorand-sdk/client/v2/common" 8 "github.com/algorand/go-algorand-sdk/client/v2/common/models" 9 ) 10 11 // GetTransactionProofParams contains all of the query parameters for url serialization. 12 type GetTransactionProofParams struct { 13 14 // Format configures whether the response object is JSON or MessagePack encoded. 15 Format string `url:"format,omitempty"` 16 17 // Hashtype the type of hash function used to create the proof, must be one of: 18 // * sha512_256 19 // * sha256 20 Hashtype string `url:"hashtype,omitempty"` 21 } 22 23 // GetTransactionProof get a proof for a transaction in a block. 24 type GetTransactionProof struct { 25 c *Client 26 27 round uint64 28 txid string 29 30 p GetTransactionProofParams 31 } 32 33 // Hashtype the type of hash function used to create the proof, must be one of: 34 // * sha512_256 35 // * sha256 36 func (s *GetTransactionProof) Hashtype(Hashtype string) *GetTransactionProof { 37 s.p.Hashtype = Hashtype 38 39 return s 40 } 41 42 // Do performs the HTTP request 43 func (s *GetTransactionProof) Do(ctx context.Context, headers ...*common.Header) (response models.TransactionProofResponse, err error) { 44 err = s.c.get(ctx, &response, fmt.Sprintf("/v2/blocks/%s/transactions/%s/proof", common.EscapeParams(s.round, s.txid)...), s.p, headers) 45 return 46 }