Sign Contract Batch

API Endpoint

Input Parameters

session-idYstringID for the storage upload session.Y
peer-idNstringClient that requires the offline signsN
nonce-timestampYint64Timestamp used for nonce. Must be within 1 hour of server time.N
upload-session-signatureYstringPrivate key-signed string of “::” for this delegated request.N
session-statusYstringThe “status” API session status that is received right before calling this API.N
signed-data-itemsYstringResult of offline signing of the Contracts. This is an array of json marshalled Contract which is defined at the Response of getcontractbatch API.
But Contract.ContractData has signed data bytes in string format.


// Usage

signbatch, err = s.StorageUploadSignBatch(sessionId, mhash, c, uts, storage.Status)

// Go Wrapper

func (s *Shell) StorageUploadSignBatch(sid string, hash string, unsignedBatchContracts *Contracts, uts string, sessionStatus string) error {
    var signedBatchContracts *Contracts
    var errSign error
    offlinePeerSessionSignature, err := getSessionSignature()
    if err != nil {
        return err

    signedBatchContracts, errSign = unsignedBatchContracts.SignContracts(utils.GetPrivateKey(), sessionStatus)
    if errSign != nil {
        return err
    bytesSignBatch, err := json.Marshal(signedBatchContracts.Contracts)
    if err != nil {
        return err

    rb := s.Request("storage/upload/signcontractbatch", sid, utils.GetPeerId(), uts, offlinePeerSessionSignature,
        sessionStatus, string(bytesSignBatch))
    return rb.Exec(context.Background(), nil)
curl -X POST