package custodial import ( "context" "github.com/carlmjohnson/requests" ) type ( CustodialClient struct { endpoint string } SignTransferPayload struct { Amount uint `json:"amount"` From string `json:"from"` To string `json:"to"` VoucherAddress string `json:"voucherAddress"` } CustodialResponse struct { Ok bool `json:"ok"` Result struct { TrackingId string `json:"trackingId"` } `json:"result"` } ) func New(endpoint string) *CustodialClient { return &CustodialClient{ endpoint: endpoint, } } func (cc *CustodialClient) SignTransfer(ctx context.Context, payload SignTransferPayload) (string, error) { var resp CustodialResponse if err := requests. URL(cc.endpoint). BodyJSON(&payload). ToJSON(&resp). Fetch(ctx); err != nil { return "", err } return resp.Result.TrackingId, nil }