Example #1
0
        /// <summary>
        /// append signature for multi address tx
        /// </summary>
        /// <param name="signContext"></param>
        /// <returns></returns>
        public async Task <object> AppendSignature(string signContext)
        {
            if (CurrentWallet == null)
            {
                return(Error(ErrorCode.WalletNotOpen));
            }

            ContractParametersContext context;

            try
            {
                context = ContractParametersContext.FromJson(signContext.DeserializeJson <JObject>(), Helpers.GetDefaultSnapshot());
            }
            catch (Exception e)
            {
                return(Error(ErrorCode.InvalidPara));
            }

            if (CurrentWallet.SignContext(context))
            {
                return(context.SafeSerialize());
            }
            return(Error(ErrorCode.SignFail, context.SafeSerialize()));
        }