github.com/ZuluSpl0it/Sia@v1.3.7/node/api/client/transactionpool.go (about) 1 package client 2 3 import ( 4 "net/url" 5 6 "github.com/NebulousLabs/Sia/encoding" 7 "github.com/NebulousLabs/Sia/node/api" 8 "github.com/NebulousLabs/Sia/types" 9 ) 10 11 // TransactionPoolFeeGet uses the /tpool/fee endpoint to get a fee estimation. 12 func (c *Client) TransactionPoolFeeGet() (tfg api.TpoolFeeGET, err error) { 13 err = c.get("/tpool/fee", &tfg) 14 return 15 } 16 17 // TransactionPoolRawPost uses the /tpool/raw endpoint to send a raw 18 // transaction to the transaction pool. 19 func (c *Client) TransactionPoolRawPost(txn types.Transaction, parents types.Transaction) (err error) { 20 values := url.Values{} 21 values.Set("transaction", string(encoding.Marshal(txn))) 22 values.Set("parents", string(encoding.Marshal(parents))) 23 err = c.post("/tpool/raw", values.Encode(), nil) 24 return 25 }