示例#1
0
        /// <summary>
        /// Sign the transaction.
        /// </summary>
        /// <param name="callback">The callback for the blob of sign result.</param>
        public void Sign(MessageCallback <string> callback)
        {
            if (_txJson.Sequence.HasValue)
            {
                SignInternal(callback);
            }
            else
            {
                var req = _remote.RequestAccountInfo(new AccountInfoOptions {
                    Account = _txJson.Account
                });
                req.Submit(accountInfoResult =>
                {
                    if (accountInfoResult.Exception != null)
                    {
                        callback?.Invoke(new MessageResult <string>("sign error: ", accountInfoResult.Exception));
                        return;
                    }

                    var accountInfo  = accountInfoResult.Result;
                    _txJson.Sequence = accountInfo.AccountData.Sequence;
                    SignInternal(callback);
                });
            }
        }
示例#2
0
        /// <summary>
        /// Sign the transaction.
        /// </summary>
        /// <param name="callback">The callback for the blob of sign result.</param>
        public void Sign(MessageCallback <string> callback)
        {
            var req = _remote.RequestAccountInfo(new AccountInfoOptions {
                Account = _txJson.Account
            });

            req.Submit(accountInfoResult =>
            {
                Sign(accountInfoResult, callback);
            });
        }