func (c *Client) SendRequest(request *RequestCredential, myDID, theirDID string) (string, error) {
	if request == nil {
		return "", errEmptyRequest
	}
	request.Type = issuecredential.RequestCredentialMsgType
	return c.service.HandleOutbound(service.NewDIDCommMsgMap(request), myDID, theirDID)
}
SendRequest is used by the Holder to send a request.
package issuecredential
import (
	"errors"
	"github.com/hyperledger/aries-framework-go/pkg/didcomm/common/service"
	"github.com/hyperledger/aries-framework-go/pkg/didcomm/protocol/issuecredential"
)
var (
	errEmptyOffer    = errors.New("received an empty offer")
	errEmptyProposal = errors.New("received an empty proposal")
	errEmptyRequest  = errors.New("received an empty request")
)
type (
	OfferCredential issuecredential.OfferCredential
	ProposeCredential issuecredential.ProposeCredential
	RequestCredential issuecredential.RequestCredential
	IssueCredential issuecredential.IssueCredential
	Action issuecredential.Action
)
type Provider interface {
	Service(id string) (interface{}, error)
}
type ProtocolService interface {
	service.DIDComm
	Actions() ([]issuecredential.Action, error)
	ActionContinue(piID string, opt issuecredential.Opt) error
	ActionStop(piID string, err error) error
}
type Client struct {
	service.Event
	service ProtocolService
}
func New(ctx Provider) (*Client, error) {
	raw, err := ctx.Service(issuecredential.Name)
	if err != nil {
		return nil, err
	}
	svc, ok := raw.(ProtocolService)
	if !ok {
		return nil, errors.New("cast service to issuecredential service failed")
	}
	return &Client{
		Event:   svc,
		service: svc,
	}, nil
}
func (c *Client) Actions() ([]Action, error) {
	actions, err := c.service.Actions()
	if err != nil {
		return nil, err
	}
	result := make([]Action, len(actions))
	for i, action := range actions {
		result[i] = Action(action)
	}
	return result, nil
}
func (c *Client) SendOffer(offer *OfferCredential, myDID, theirDID string) (string, error) {
	if offer == nil {
		return "", errEmptyOffer
	}
	offer.Type = issuecredential.OfferCredentialMsgType
	return c.service.HandleOutbound(service.NewDIDCommMsgMap(offer), myDID, theirDID)
}
func (c *Client) SendProposal(proposal *ProposeCredential, myDID, theirDID string) (string, error) {
	if proposal == nil {
		return "", errEmptyProposal
	}
	proposal.Type = issuecredential.ProposeCredentialMsgType
	return c.service.HandleOutbound(service.NewDIDCommMsgMap(proposal), myDID, theirDID)
}