コード例 #1
0
        public SignRawTransactionWithKeyResponse SignRawTransactionWithKey(SignRawTransactionWithKeyRequest request)
        {
            #region default values

            if (request.PrivateKeys.Count == 0)
            {
                request.PrivateKeys = null;
            }

            if (request.Inputs.Count == 0)
            {
                request.Inputs = null;
            }

            if (string.IsNullOrWhiteSpace(request.SigHashType))
            {
                request.SigHashType = SigHashType.All;
            }

            #endregion

            return(_rpcConnector.MakeRequest <SignRawTransactionWithKeyResponse>(RpcMethods.signrawtransactionwithkey, request.RawTransactionHex, request.PrivateKeys, request.Inputs, request.SigHashType));
        }
コード例 #2
0
        public Task <SignRawTransactionWithKeyResponse> SignRawTransactionWithKeyAsync(SignRawTransactionWithKeyRequest request, CancellationToken cancellationToken)
        {
            #region default values

            if (request.PrivateKeys.Count == 0)
            {
                request.PrivateKeys = null;
            }

            if (request.Inputs.Count == 0)
            {
                request.Inputs = null;
            }

            if (string.IsNullOrWhiteSpace(request.SigHashType))
            {
                request.SigHashType = SigHashType.All;
            }

            #endregion

            return(_asyncRpcConnector.MakeRequestAsync <SignRawTransactionWithKeyResponse>(RpcMethods.signrawtransactionwithkey, cancellationToken, request.RawTransactionHex, request.PrivateKeys, request.Inputs, request.SigHashType));
        }