private void ApplyTxSettings <T>(TxSettings settings, Transaction <T> tx) where T : GeneralTxResponse { tx.SetSecret(settings.Secret); if (!string.IsNullOrEmpty(settings.Memo)) { tx.AddMemo(settings.Memo); } if (settings.Fee != null) { tx.SetFee(settings.Fee.Value); } if (!string.IsNullOrEmpty(settings.Path)) { tx.SetPath(settings.Path); } if (settings.TransferRate != null) { tx.SetTransferRate(settings.TransferRate.Value); } if (settings.Flags != null) { tx.SetFlags(settings.Flags.Value); } if (settings.SendMax != null && settings.SendMax.Currency != null) { tx.SetSendMax(settings.SendMax); } }
private void InitBuildOfferCancelTxOptions() { var options = new OfferCancelTxOptions(); options.Account = "j9FGhAW9dSzL3RjbXkyW6Z6bHGxFk8cmB1"; options.Sequence = 1; pgBuildOfferCancelTxOptions.SelectedObject = options; var settings = new TxSettings(); settings.Secret = "ssGkkAMnKCBkhGVQd9CNzSQv5zdNi"; settings.SendMax = new Amount(); pgBuildOfferCancelTxSettings.SelectedObject = settings; }
private void InitBuildAccountSetTxOptions() { var options = new AccountSetTxOptions(); options.Type = AccountSetType.Property; options.Account = "j9FGhAW9dSzL3RjbXkyW6Z6bHGxFk8cmB1"; pgBuildAccountSetTxOptions.SelectedObject = options; var settings = new TxSettings(); settings.Secret = "ssGkkAMnKCBkhGVQd9CNzSQv5zdNi"; settings.SendMax = new Amount(); pgBuildAccountSetTxSettings.SelectedObject = settings; }
private void InitBuildPaymentTxOptions() { var options = new PaymentTxOptions(); options.Account = "j9FGhAW9dSzL3RjbXkyW6Z6bHGxFk8cmB1"; options.To = "jBKaXuYemkAb5HytZgosAcWgWDZbBvz6KR"; options.Amount = new Amount("SWT", "", "0.5"); pgBuildPaymentTxOptions.SelectedObject = options; var settings = new TxSettings(); settings.Secret = "ssGkkAMnKCBkhGVQd9CNzSQv5zdNi"; settings.SendMax = new Amount(); pgBuildPaymentTxSettings.SelectedObject = settings; }
private void InitCallContractTxOptions() { var options = new CallContractTxOptions(); options.Account = "j9FGhAW9dSzL3RjbXkyW6Z6bHGxFk8cmB1"; options.Destination = "jaVDaozkmFzCGwuBYL5wQ3SvhnUrySuofn"; options.Foo = "foo"; options.Params = new string[] { "j9FGhAW9dSzL3RjbXkyW6Z6bHGxFk8cmB1" }; pgCallContractTxOptions.SelectedObject = options; var settings = new TxSettings(); settings.Secret = "ssGkkAMnKCBkhGVQd9CNzSQv5zdNi"; settings.SendMax = new Amount(); pgCallContractTxSettings.SelectedObject = settings; }
private void InitDeployContractTxOptions() { var options = new DeployContractTxOptions(); options.Account = "j9FGhAW9dSzL3RjbXkyW6Z6bHGxFk8cmB1"; options.Amount = 30; options.Payload = "result={}; function Init(t) result=scGetAccountInfo(t) return result end; function foo(t) a={} result=scGetAccountInfo(t) return result end;"; options.Params = new string[] { "j9FGhAW9dSzL3RjbXkyW6Z6bHGxFk8cmB1" }; pgDeployContractTxOptions.SelectedObject = options; var settings = new TxSettings(); settings.Secret = "ssGkkAMnKCBkhGVQd9CNzSQv5zdNi"; settings.SendMax = new Amount(); pgDeployContractTxSettings.SelectedObject = settings; }
private void InitBuildRelationTxOptions() { var options = new RelationTxOptions(); options.Account = "j9FGhAW9dSzL3RjbXkyW6Z6bHGxFk8cmB1"; options.Target = "jBKaXuYemkAb5HytZgosAcWgWDZbBvz6KR"; options.Limit = new Amount { Currency = "CNY", Value = "0.01", Issuer = "jBciDE8Q3uJjf111VeiUNM775AMKHEbBLS" }; pgBuildRelationTxOptions.SelectedObject = options; var settings = new TxSettings(); settings.Secret = "ssGkkAMnKCBkhGVQd9CNzSQv5zdNi"; settings.SendMax = new Amount(); pgBuildRelationTxSettings.SelectedObject = settings; }
private void InitBuildOfferCreateTxOptions() { var options = new OfferCreateTxOptions(); options.Type = OfferType.Sell; options.Account = "j9FGhAW9dSzL3RjbXkyW6Z6bHGxFk8cmB1"; options.TakerPays = new Amount { Currency = "CNY", Issuer = "jBciDE8Q3uJjf111VeiUNM775AMKHEbBLS", Value = "0.01" }; options.TakerGets = new Amount { Currency = "SWT", Issuer = "", Value = "1" }; pgBuildOfferCreateTxOptions.SelectedObject = options; var settings = new TxSettings(); settings.Secret = "ssGkkAMnKCBkhGVQd9CNzSQv5zdNi"; settings.SendMax = new Amount(); pgBuildOfferCreateTxSettings.SelectedObject = settings; }