コード例 #1
0
        /// <summary>
        /// Update an account to witness.Requires 250,000 vested SPHTX before updating.
        /// </summary>
        /// <param name="accountName">Input string accountName</param>
        /// <param name="descriptionUrl">A URL containing some information about the witness.  The empty string makes it remain the same.</param>
        /// <param name="blockSigningKey">The new block signing public key.  The empty string disables block production.</param>
        /// <param name="accountCreationPrice"></param>
        /// <param name="maxBlockSizeLimit"></param>
        /// <param name="priceFeed"></param>
        /// <param name="privateKey"></param>
        /// <returns>Returns true if success or false for failed try</returns>
        public TransactionResponse UpdateWitness(string accountName, string descriptionUrl, string blockSigningKey,
                                                 string accountCreationPrice, int maxBlockSizeLimit, List <List <PrizeFeedQuoteMessage> > priceFeed, string privateKey)
        {
            try
            {
                var pros = new ChainProperties
                {
                    AccountCreationFee = accountCreationPrice,
                    MaximumBlockSize   = maxBlockSizeLimit,
                    PriceFeeds         = priceFeed
                };

                var reqname = CSharpToCpp.GetValue(MethodBase.GetCurrentMethod().Name);
                var @params = new ArrayList {
                    accountName, descriptionUrl, blockSigningKey, pros
                };
                var result      = SendRequest(reqname, @params, typeof(PrizeFeedQuoteMessage));
                var contentdata = JsonConvert.DeserializeObject <AccountResponse>(result);

                var response = StartBroadcasting(contentdata.Result, privateKey);
                return(response);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
コード例 #2
0
 /// <summary>
 /// gets the list of keys
 /// </summary>
 /// <returns>the keys result</returns>
 public string ListKeys()
 {
     try
     {
         var reqname = CSharpToCpp.GetValue(MethodBase.GetCurrentMethod().Name);
         var result  = SendRequest(reqname);
         return(result);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
コード例 #3
0
 /// <summary>
 /// Create a passphrase for users to remember easily and use ot to generate
 /// corresponding public and private keys
 /// </summary>
 /// <returns>Returns a passphrase</returns>
 public BrainKeySuggestion SuggestBrainKey()
 {
     try
     {
         var reqname     = CSharpToCpp.GetValue(MethodBase.GetCurrentMethod().Name);
         var result      = SendRequest(reqname);
         var contentdata = JsonConvert.DeserializeObject <BrainKeySuggestion>(result);
         return(contentdata);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
コード例 #4
0
 /// <summary>
 /// Returns the list of witnesses producing blocks in the current round (21 Blocks)
 /// </summary>
 /// <returns>Returns json object combining list of active witnesses</returns>
 public ActiveWitnessResponse GetActiveWitnesses()
 {
     try
     {
         var reqname     = CSharpToCpp.GetValue(MethodBase.GetCurrentMethod().Name);
         var result      = SendRequest(reqname);
         var contentdata = JsonConvert.DeserializeObject <ActiveWitnessResponse>(result);
         return(contentdata);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
コード例 #5
0
 /// <summary>
 /// gets the list of keys
 /// </summary>
 /// <returns>the keys result</returns>
 public string ListKeys()
 {
     try
     {
         var reqname = CSharpToCpp.GetValue(MethodBase.GetCurrentMethod().Name);
         var result  = SendRequest(reqname);
         return(result);
     }
     catch (Exception ex)
     {
         _logger.WriteError($"Message:{ex.Message} | StackTrace:{ex.StackTrace}");
         throw;
     }
 }
コード例 #6
0
 /// <summary>
 /// Returns info such as client version, git version of graphene/fc, version of boost, openssl.
 /// </summary>
 /// <returns>Returns compile time info And client And dependencies versions</returns>
 public AboutResponse About()
 {
     try
     {
         var reqname     = CSharpToCpp.GetValue(MethodBase.GetCurrentMethod().Name);
         var result      = SendRequest(reqname);
         var contentdata = JsonConvert.DeserializeObject <AboutResponse>(result);
         return(contentdata);
     }
     catch (Exception ex)
     {
         _logger.WriteError($"Message:{ex.Message} | StackTrace:{ex.StackTrace}");
         throw;
     }
 }
コード例 #7
0
 /// <summary>
 /// Vote on a comment to be paid Sophia
 /// </summary>
 /// <param name="voter">The account voting</param>
 /// <param name="author">The author Of the comment To be voted On</param>
 /// <param name="permlink">The permlink Of the comment To be voted On. (author, permlink) Is a unique pair</param>
 /// <param name="weight">The weight [-100,100] Of the vote</param>
 /// <returns>the vote response data</returns>
 public string Vote(string voter, string author, string permlink, short weight)
 {
     try
     {
         var reqname = CSharpToCpp.GetValue(MethodBase.GetCurrentMethod().Name);
         var @params = new ArrayList {
             voter, author, permlink, weight
         };
         return(SendRequest(reqname, @params));
     }
     catch (Exception ex)
     {
         throw;
     }
 }
コード例 #8
0
        /// <summary>
        /// Returns info such as client version, git version of graphene/fc, version of boost, openssl.
        /// </summary>
        /// <returns>Returns compile time info And client And dependencies versions</returns>
        public async Task <AboutResponse> AboutAsync()
        {
            try
            {
                var reqname = CSharpToCpp.GetValue("About");
                var result  = await SendRequestAsync(reqname);

                var contentdata = JsonConvert.DeserializeObject <AboutResponse>(result);
                return(contentdata);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
コード例 #9
0
 /// <summary>
 /// Returns the owner authority of the given account.
 /// </summary>
 /// <param name="accountName">Input string accountName</param>
 /// <returns>Returns the Json object with the deails about the owner authority</returns>
 public SimpleAuthorityResponse GetOwnerAuthority(string accountName)
 {
     try
     {
         var reqname = CSharpToCpp.GetValue(MethodBase.GetCurrentMethod().Name);
         var @params = new ArrayList {
             accountName
         };
         var result = SendRequest(reqname, @params);
         return(JsonConvert.DeserializeObject <SimpleAuthorityResponse>(result));
     }
     catch (Exception ex)
     {
         throw;
     }
 }
コード例 #10
0
 /// <summary>
 /// Creates authority resolvable with given number of​ managing accounts.
 /// </summary>
 /// <param name="managingAccounts">Input List of string managingAccounts</param>
 /// <param name="requiredSignatures">Input uint requiredSignatures</param>
 /// <returns>Returns Json object with details combining</returns>
 public ManagedAuthorityResponse CreateSimpleMultiManagedAuthority(List <string> managingAccounts, uint requiredSignatures)
 {
     try
     {
         var reqname = CSharpToCpp.GetValue(MethodBase.GetCurrentMethod().Name);
         var @params = new ArrayList {
             managingAccounts, requiredSignatures
         };
         var result = SendRequest(reqname, @params);
         return(JsonConvert.DeserializeObject <ManagedAuthorityResponse>(result));
     }
     catch (Exception ex)
     {
         throw;
     }
 }
コード例 #11
0
ファイル: Asset.cs プロジェクト: SophiaTX/Alexandria-C-SHARP
 /// <summary>
 /// Checks if the given UIA has a private key, identify by Sumbol
 /// </summary>
 /// <param name="assetSymbol">string assetSymbol</param>
 /// <returns>Returns true if success or false for failed try</returns>
 private bool HasUiaPrivateKey(string assetSymbol)
 {
     try
     {
         var reqname = CSharpToCpp.GetValue(MethodBase.GetCurrentMethod().Name);
         var @params = new ArrayList {
             assetSymbol
         };
         var result = SendRequest(reqname, @params);
         return(result == "true");
     }
     catch (Exception ex)
     {
         throw;
     }
 }
コード例 #12
0
ファイル: Asset.cs プロジェクト: SophiaTX/Alexandria-C-SHARP
 /// <summary>
 /// Returns the balance of the given account and UIA
 /// </summary>
 /// <param name="accountName">string accountName</param>
 /// <param name="assetSymbol">string assetSymbol</param>
 /// <returns>Returns retruns ulong Accournt balance</returns>
 private ulong GetAccountUiaBalance(string accountName, string assetSymbol)
 {
     try
     {
         var reqname = CSharpToCpp.GetValue(MethodBase.GetCurrentMethod().Name);
         var @params = new ArrayList {
             accountName, assetSymbol
         };
         var result = SendRequest(reqname, @params);
         return(Convert.ToUInt64(result));
     }
     catch (Exception ex)
     {
         throw;
     }
 }
コード例 #13
0
ファイル: Asset.cs プロジェクト: SophiaTX/Alexandria-C-SHARP
 /// <summary>
 /// Check for the authority assigned to given UIA, identify by Symbol
 /// </summary>
 /// <param name="assetSymbol">string assetSymbol</param>
 /// <returns>Returns Json object with details combining</returns>
 private Authority GetUiaAuthority(string assetSymbol)
 {
     try
     {
         var reqname = CSharpToCpp.GetValue(MethodBase.GetCurrentMethod().Name);
         var @params = new ArrayList {
             assetSymbol
         };
         var result = SendRequest(reqname, @params);
         return(JsonConvert.DeserializeObject <Authority>(result));
     }
     catch (Exception ex)
     {
         throw;
     }
 }
コード例 #14
0
ファイル: Asset.cs プロジェクト: SophiaTX/Alexandria-C-SHARP
 /// <summary>
 /// Issues an UIA for the Receiver account of given ammount
 /// </summary>
 /// <param name="reveiverAccountName">string reveiverAccountName</param>
 /// <param name="amount">ulong amount</param>
 /// <param name="assetSymbol">string assetSymbol</param>
 /// <returns>Returns true if success or false for failed try</returns>
 private bool IssueUia(string reveiverAccountName, ulong amount, string assetSymbol)
 {
     try
     {
         var reqname = CSharpToCpp.GetValue(MethodBase.GetCurrentMethod().Name);
         var @params = new ArrayList {
             reveiverAccountName, amount, assetSymbol
         };
         var result = SendRequest(reqname, @params);
         return(result == "true");
     }
     catch (Exception ex)
     {
         throw;
     }
 }
コード例 #15
0
 /// <summary>
 /// Normalizes the case of passphrase for correct key generation
 /// </summary>
 /// <param name="brainKey">distorted passphrase</param>
 /// <returns>Returns normalized Passphrase</returns>
 public string NormalizeBrainKey(string brainKey)
 {
     try
     {
         var reqname = CSharpToCpp.GetValue(MethodBase.GetCurrentMethod().Name);
         var @params = new ArrayList {
             brainKey
         };
         var result = SendRequest(reqname, @params);
         return(result);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
コード例 #16
0
ファイル: Asset.cs プロジェクト: SophiaTX/Alexandria-C-SHARP
 /// <summary>
 /// Create UIA for the given account authority
 /// </summary>
 /// <param name="ownerAccountName">string ownerAccountName</param>
 /// <param name="managementAuthority">Authority managementAuthority</param>
 /// <param name="maxSupply">ulong maxSupply</param>
 /// <param name="assetSymbol">string assetSymbol</param>
 /// <returns>Returns true if success or false for failed try</returns>
 private bool CreateUia(string ownerAccountName, Authority managementAuthority, ulong maxSupply, string assetSymbol)
 {
     try
     {
         var reqname = CSharpToCpp.GetValue(MethodBase.GetCurrentMethod().Name);
         var @params = new ArrayList {
             ownerAccountName, managementAuthority, maxSupply, assetSymbol
         };
         var result = SendRequest(reqname, @params);
         return(result == "true");
     }
     catch (Exception ex)
     {
         throw;
     }
 }
コード例 #17
0
 /// <summary>
 /// Creates authority resolvable with a given managing account.
 /// </summary>
 /// <param name="managingAccountName">string managingAccountName</param>
 /// <returns>Returns Json object with details combining</returns>
 public object CreateSimpleManagedAuthority(string managingAccountName)
 {
     try
     {
         var reqname = CSharpToCpp.GetValue(MethodBase.GetCurrentMethod().Name);
         var @params = new ArrayList {
             managingAccountName
         };
         var result = SendRequest(reqname, @params);
         return(JsonConvert.DeserializeObject <object>(result));
     }
     catch (Exception ex)
     {
         throw;
     }
 }
コード例 #18
0
 /// <summary>
 /// Vote on a comment to be paid Sophia
 /// </summary>
 /// <param name="voter">The account voting</param>
 /// <param name="author">The author Of the comment To be voted On</param>
 /// <param name="permlink">The permlink Of the comment To be voted On. (author, permlink) Is a unique pair</param>
 /// <param name="weight">The weight [-100,100] Of the vote</param>
 /// <returns>the vote response data</returns>
 public string Vote(string voter, string author, string permlink, short weight)
 {
     try
     {
         var reqname = CSharpToCpp.GetValue(MethodBase.GetCurrentMethod().Name);
         var @params = new ArrayList {
             voter, author, permlink, weight
         };
         return(SendRequest(reqname, @params));
     }
     catch (Exception ex)
     {
         _logger.WriteError($"Message:{ex.Message} | StackTrace:{ex.StackTrace}");
         throw;
     }
 }
コード例 #19
0
 /// <summary>
 /// Returns information about the given witness.
 /// </summary>
 /// <param name="ownerAccount">the name Or id Of the witness account owner, Or the id of the witness</param>
 /// <returns>the information about the witness stored In the block chain</returns>
 public GetWitnessResponse GetWitness(string ownerAccount)
 {
     try
     {
         var reqname = CSharpToCpp.GetValue(MethodBase.GetCurrentMethod().Name);
         var @params = new ArrayList {
             ownerAccount
         };
         var result      = SendRequest(reqname, @params);
         var contentdata = JsonConvert.DeserializeObject <GetWitnessResponse>(result);
         return(contentdata);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
コード例 #20
0
 /// <summary>
 /// Sequence of operations included/generated in a specified block
 /// </summary>
 /// <param name="blockNumber">Integer Block Number </param>
 /// <param name="onlyVirtual">Boolean Only Virtual operation listing</param>
 /// <returns>Returns sequence of operations included/generated in a specified block</returns>
 public GetOperationsResponse GetOpsInBlock(uint blockNumber, bool onlyVirtual)
 {
     try
     {
         var reqname = CSharpToCpp.GetValue(MethodBase.GetCurrentMethod().Name);
         var @params = new ArrayList {
             blockNumber, onlyVirtual
         };
         var result      = SendRequest(reqname, @params);
         var contentdata = JsonConvert.DeserializeObject <GetOperationsResponse>(result);
         return(contentdata);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
コード例 #21
0
 /// <summary>
 /// Allowed options for search_type are "by_sender", "by_recipient", "by_sender_datetime", "by_recipient_datetime".
 /// Account is then either sender or recevier, and start is either index od ISO time stamp.
 /// </summary>
 /// <param name="appId">the application id</param>
 /// <param name="searchType"></param>
 /// <param name="account"></param>
 /// <param name="start"></param>
 /// <param name="count"></param>
 /// <returns></returns>
 private ReceivedDocumentResponse GetReceivedDocuments(ulong appId,
                                                       string account, SearchType searchType, DateTime start, uint count)
 {
     try
     {
         var reqname = CSharpToCpp.GetValue(MethodBase.GetCurrentMethod().Name);
         var @params = new ArrayList {
             appId, account, searchType.GetStringValue(), start, count
         };
         var result = SendRequest(reqname, @params);
         return(JsonConvert.DeserializeObject <ReceivedDocumentResponse>(result));
     }
     catch (Exception ex)
     {
         throw;
     }
 }
コード例 #22
0
 /// <summary>
 /// creates the custom json operation
 /// </summary>
 /// <param name="sender">string sender</param>
 /// <param name="recipients">List of string recipients</param>
 /// <param name="appId">the application id</param>
 /// <param name="document">string document</param>
 /// <returns>the account response data </returns>
 private AccountResponse MakeCustomBinaryBase58Operation(string sender, List <string> recipients, ulong appId,
                                                         string document)
 {
     try
     {
         var reqname = CSharpToCpp.GetValue(MethodBase.GetCurrentMethod().Name);
         var @params = new ArrayList {
             sender, recipients, appId, document
         };
         var response = SendRequest(reqname, @params);
         return(JsonConvert.DeserializeObject <AccountResponse>(response));
     }
     catch (Exception ex)
     {
         throw;
     }
 }
コード例 #23
0
 /// <summary>
 /// Serialize currently generated transaction on to the blockchain with other transactions
 /// </summary>
 /// <param name="signedTx">Already signed transaction</param>
 /// <returns>object</returns>
 public SerializedTransaction SerializeTransaction(SignedTransactionResponse signedTx)
 {
     try
     {
         var reqname = CSharpToCpp.GetValue(MethodBase.GetCurrentMethod().Name);
         var @params = new ArrayList {
             signedTx
         };
         var result      = SendRequest(reqname, @params);
         var contentdata = JsonConvert.DeserializeObject <SerializedTransaction>(result);
         return(contentdata);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
コード例 #24
0
 /// <summary>
 /// Returns the balance of the given account and UIA
 /// </summary>
 /// <param name="accountName">string accountName</param>
 /// <param name="assetSymbol">string assetSymbol</param>
 /// <returns>Returns retruns ulong Accournt balance</returns>
 private ulong GetAccountUiaBalance(string accountName, string assetSymbol)
 {
     try
     {
         var reqname = CSharpToCpp.GetValue(MethodBase.GetCurrentMethod().Name);
         var @params = new ArrayList {
             accountName, assetSymbol
         };
         var result = SendRequest(reqname, @params);
         return(Convert.ToUInt64(result));
     }
     catch (Exception ex)
     {
         _logger.WriteError($"Message:{ex.Message} | StackTrace:{ex.StackTrace}");
         throw;
     }
 }
コード例 #25
0
 /// <summary>
 /// Adds signature to JSON formatted transaction
 /// </summary>
 /// <param name="transaction">string transaction</param>
 /// <param name="signature">string signature</param>
 /// <returns>Returns true if success or false for failed try</returns>
 public SignedTransactionResponse AddSignatureServer(TransactionResponse transaction, string signature)
 {
     try
     {
         var reqname = CSharpToCpp.GetValue(MethodBase.GetCurrentMethod().Name);
         var @params = new ArrayList {
             transaction.Result, signature
         };
         var signedTransaction = SendRequest(reqname, @params);
         var result            = JsonConvert.DeserializeObject <SignedTransactionResponse>(signedTransaction);
         return(result);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
コード例 #26
0
 /// <summary>
 /// Creates digest of JSON formatted transaction
 /// </summary>
 /// <param name="transaction">the transaction to digest</param>
 /// <returns>Returns true if success or false for failed try</returns>
 public GetTransactionDigestResponse GetTransactionDigestServer(string transaction)
 {
     try
     {
         var reqname = CSharpToCpp.GetValue(MethodBase.GetCurrentMethod().Name);
         var @params = new ArrayList {
             transaction
         };
         var result      = SendRequest(reqname, @params);
         var contentdata = JsonConvert.DeserializeObject <GetTransactionDigestResponse>(result);
         return(contentdata);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
コード例 #27
0
 /// <summary>
 /// Returns information about the block
 /// </summary>
 /// <param name="num">the block num</param>
 /// <returns>Public block data On the blockchain</returns>
 public BlockResponse GetBlock(uint num)
 {
     try
     {
         var reqname = CSharpToCpp.GetValue(MethodBase.GetCurrentMethod().Name);
         var @params = new ArrayList {
             num
         };
         var result      = SendRequest(reqname, @params);
         var contentdata = JsonConvert.DeserializeObject <BlockResponse>(result);
         return(contentdata);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
コード例 #28
0
 /// <summary>
 /// Lists all witnesses registered in the blockchain.
 /// This returns a list of all account names that own witnesses, and the associated witness id,
 /// sorted by name.  This lists witnesses whether they are currently voted in or not.
 /// </summary>
 /// <param name="lowerbound">the name Of the first witness To Return.
 /// If the named witness does Not exist, the list will start at the witness thatcomes after 'lowerbound'</param>
 /// <param name="limit">the maximum number Of witnesss To return (max: 1000)</param>
 /// <returns>Returns a list of witnesss mapping witness names To witness ids</returns>
 public ActiveWitnessResponse ListWitnesses(string lowerbound, uint limit)
 {
     try
     {
         var reqname = CSharpToCpp.GetValue(MethodBase.GetCurrentMethod().Name);
         var @params = new ArrayList {
             lowerbound, limit
         };
         var result      = SendRequest(reqname, @params);
         var contentdata = JsonConvert.DeserializeObject <ActiveWitnessResponse>(result);
         return(contentdata);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
コード例 #29
0
 /// <summary>
 /// Checks if the given UIA has a private key, identify by Sumbol
 /// </summary>
 /// <param name="assetSymbol">string assetSymbol</param>
 /// <returns>Returns true if success or false for failed try</returns>
 private bool HasUiaPrivateKey(string assetSymbol)
 {
     try
     {
         var reqname = CSharpToCpp.GetValue(MethodBase.GetCurrentMethod().Name);
         var @params = new ArrayList {
             assetSymbol
         };
         var result = SendRequest(reqname, @params);
         return(result == "true");
     }
     catch (Exception ex)
     {
         _logger.WriteError($"Message:{ex.Message} | StackTrace:{ex.StackTrace}");
         throw;
     }
 }
コード例 #30
0
 /// <summary>
 /// Add the calculated fees to the transaction
 /// </summary>
 /// <param name="operation">Operation object</param>
 /// <param name="fee">Calculated Fees</param>
 /// <typeparam name="T">Type of operation object</typeparam>
 /// <returns>object</returns>
 public AccountResponse AddFee <T>(T operation, string fee)
 {
     try
     {
         var reqname = CSharpToCpp.GetValue(MethodBase.GetCurrentMethod().Name);
         var @params = new ArrayList {
             operation, fee
         };
         var result      = SendRequest(reqname, @params);
         var contentdata = JsonConvert.DeserializeObject <AccountResponse>(result);
         return(contentdata);
     }
     catch (Exception ex)
     {
         throw;
     }
 }