Skip to content

Commit

Permalink
Add relay_tx
Browse files Browse the repository at this point in the history
  • Loading branch information
duggavo committed May 29, 2023
1 parent 161e5a1 commit 378043d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
11 changes: 11 additions & 0 deletions rpc/wallet/jsonrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,5 +152,16 @@ func (c *Client) SweepAll(ctx context.Context, params SweepAllParams) (*SweepAll
}

return resp, nil
}

func (c *Client) RelayTx(ctx context.Context, hex string) (*RelayTxResult, error) {
resp := &RelayTxResult{}

if err := c.JSONRPC(ctx, "relay_tx", map[string]string{
"hex": hex,
}, resp); err != nil {
return nil, fmt.Errorf("jsonrpc: %w", err)
}

return resp, nil
}
4 changes: 4 additions & 0 deletions rpc/wallet/jsonrpc_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,7 @@ type SweepAllResult struct {
WeightList []uint64 `json:"weight_list"`
TxBlobList []string `json:"tx_blob_list"`
}

type RelayTxResult struct {
TxHash string `json:"tx_hash"`
}

0 comments on commit 378043d

Please sign in to comment.