static void Main(string[] args) { const String HOST = "http://colunode.cloudapp.net"; const String USERNAME = "******"; const String PASSWORD = "******"; string a; using (IAddressClient client = new Client(HOST)) { String id = Guid.NewGuid().ToString(); var response = client.GetAddressAsync(id).Result; a = response.Address; } using (Client client = new Client(HOST)) { var request = new Colu.Models.IssueAsset.Request() { Id = Guid.NewGuid().ToString() }; request.Param.Amount = 1000; request.Param.Divisibility = 0; request.Param.Reissueable = true; request.Param.IssueAddress = a; var actual = client.IssueAsync(request).Result; } }
public async Task Should_Issue_And_Transfer_Asset() { using (Client client = new Client(HOST)) { var request = new Colu.Models.IssueAsset.Request() { Id = Guid.NewGuid().ToString() }; request.Param.MetaData.AssetName = "Unit test"; request.Param.Amount = 100; request.Param.Divisibility = 0; request.Param.Reissueable = true; request.Param.IssueAddress = TESTNET_ADDRESS; request.Param.Transfer = new List <Colu.Models.To>(1); request.Param.Transfer.Add(new Colu.Models.To() { Address = RANDOM_ADDRESS_TO_RECEIVE, Amount = 1 }); var actual = await client.IssueAsync(request); Assert.IsNotNull(actual); } }
static void Main(string[] args) { const String HOST = "http://colunode.cloudapp.net"; const String USERNAME = "******"; const String PASSWORD = "******"; using (IAddressClient addressClient = new Client(HOST)) { String id = Guid.NewGuid().ToString(); var response = addressClient.GetAddressAsync(id).Result; String address = response.Address; using (Client client = new Client(HOST)) { var request = new Colu.Models.IssueAsset.Request() { Id = Guid.NewGuid().ToString() }; request.Param.Amount = 1000; request.Param.Divisibility = 0; request.Param.Reissueable = true; request.Param.IssueAddress = address; var actual = client.IssueAsync(request).Result; } } }
public async Task Should_Issue_Asset_With_Metadata_And_Image() { using (Client client = new Client(HOST, USERNAME, PASSWORD)) { var request = new Colu.Models.IssueAsset.Request() { Id = Guid.NewGuid().ToString() }; request.Param.Amount = 10; request.Param.Divisibility = 0; request.Param.Reissueable = false; request.Param.IssueAddress = TESTNET_ADDRESS; request.Param.MetaData.AssetName = "General Fisheries Permit"; request.Param.MetaData.Issuer = "Queensland Government"; var iconUrl = new Colu.Models.IssueAsset.Url() { Name = "icon", MimeType = "image/png", url = "https://blockchainpermits.azurewebsites.net/images/Fishing-Licence2.png" }; request.Param.MetaData.Urls.Add(iconUrl); var actual = await client.IssueAsync(request); Assert.IsNotNull(actual); } }
public async Task Should_Issue_1000_Assets() { using (Client client = new Client(HOST)) { var request = new Colu.Models.IssueAsset.Request() { Id = Guid.NewGuid().ToString() }; request.Param.Amount = 1000; request.Param.Divisibility = 0; request.Param.Reissueable = true; request.Param.IssueAddress = TESTNET_ADDRESS; var actual = await client.IssueAsync(request); Assert.IsNotNull(actual); Assert.IsNull(actual.Error); } }
public async Task Should_Issue_Asset_With_Metadata_And_Rules() { using (Client client = new Client(HOST)) { var request = new Colu.Models.IssueAsset.Request() { Id = Guid.NewGuid().ToString() }; request.Param.Rules = new Colu.Models.Rules(1); //TimeSpan t = DateTime.UtcNow - new DateTime(1970, 1, 1); //Int64 epoch = (Int64)t.TotalSeconds; //request.Param.Rules.Expiration.ValidUntil = 500000; request.Param.Amount = 10; request.Param.Divisibility = 0; request.Param.Reissueable = true; request.Param.IssueAddress = TESTNET_ADDRESS; request.Param.MetaData.AssetName = "General Fisheries Permit"; request.Param.MetaData.Issuer = "Queensland Government"; var iconUrl = new Colu.Models.IssueAsset.Url() { Name = "icon", MimeType = "image/png", url = "https://blockchainpermits.azurewebsites.net/images/Fishing-Licence2.png" }; request.Param.MetaData.Urls.Add(iconUrl); var actual = await client.IssueAsync(request); Assert.IsNotNull(actual); } }
public async Task Should_Issue_Asset_With_Metadata() { using (Client client = new Client(HOST, USERNAME, PASSWORD)) { var request = new Colu.Models.IssueAsset.Request() { Id = Guid.NewGuid().ToString() }; request.Param.Amount = 1000; request.Param.Divisibility = 0; request.Param.Reissueable = true; request.Param.IssueAddress = TESTNET_ADDRESS; request.Param.MetaData.AssetName = "General Fisheries Permit"; request.Param.MetaData.Issuer = "Queensland Government"; var actual = await client.IssueAsync(request); Assert.IsNotNull(actual); } }
public async Task Should_Issue_Asset_With_Metadata_And_Verification() { using (Client client = new Client(HOST, USERNAME, PASSWORD)) { var request = new Colu.Models.IssueAsset.Request() { Id = Guid.NewGuid().ToString() }; request.Param.Amount = 1; request.Param.Divisibility = 0; request.Param.Reissueable = true; request.Param.IssueAddress = TESTNET_ADDRESS; request.Param.MetaData.AssetName = "Test"; //request.Param.MetaData.Verification = new Colu.Models.IssueAsset.Verification(); //request.Param.MetaData.Verification.Domain = new Colu.Models.IssueAsset.Domain() { url = "https://www.bitpoker.io/assets.txt" }; var actual = await client.IssueAsync(request); Assert.IsNotNull(actual); } }
public async Task Should_Issue_1000_Assets() { using (Client client = new Client(HOST)) { var request = new Colu.Models.IssueAsset.Request() { Id = Guid.NewGuid().ToString() }; request.Param.Amount = 1000; request.Param.Divisibility = 0; request.Param.Reissueable = true; request.Param.IssueAddress = TESTNET_ADDRESS; var actual = await client.IssueAsync(request); Assert.IsNotNull(actual); Assert.IsNull(actual.Error); } }
public async Task Should_Issue_And_Transfer_Asset() { using (Client client = new Client(HOST)) { var request = new Colu.Models.IssueAsset.Request() { Id = Guid.NewGuid().ToString() }; request.Param.MetaData.AssetName = "Unit test"; request.Param.Amount = 100; request.Param.Divisibility = 0; request.Param.Reissueable = true; request.Param.IssueAddress = TESTNET_ADDRESS; request.Param.Transfer = new List<Colu.Models.To>(1); request.Param.Transfer.Add(new Colu.Models.To() { Address = RANDOM_ADDRESS_TO_RECEIVE, Amount = 1 }); var actual = await client.IssueAsync(request); Assert.IsNotNull(actual); } }
public async Task Should_Issue_Asset_With_Metadata_And_Rules() { using (Client client = new Client(HOST)) { var request = new Colu.Models.IssueAsset.Request() { Id = Guid.NewGuid().ToString() }; request.Param.Rules = new Colu.Models.Rules(1); //TimeSpan t = DateTime.UtcNow - new DateTime(1970, 1, 1); //Int64 epoch = (Int64)t.TotalSeconds; //request.Param.Rules.Expiration.ValidUntil = 500000; request.Param.Amount = 10; request.Param.Divisibility = 0; request.Param.Reissueable = true; request.Param.IssueAddress = TESTNET_ADDRESS; request.Param.MetaData.AssetName = "General Fisheries Permit"; request.Param.MetaData.Issuer = "Queensland Government"; var iconUrl = new Colu.Models.IssueAsset.Url() { Name = "icon", MimeType = "image/png", url = "https://blockchainpermits.azurewebsites.net/images/Fishing-Licence2.png" }; request.Param.MetaData.Urls.Add(iconUrl); var actual = await client.IssueAsync(request); Assert.IsNotNull(actual); } }
public async Task Should_Issue_Asset_With_Metadata_And_Verification() { using (Client client = new Client(HOST, USERNAME, PASSWORD)) { var request = new Colu.Models.IssueAsset.Request() { Id = Guid.NewGuid().ToString() }; request.Param.Amount = 1; request.Param.Divisibility = 0; request.Param.Reissueable = true; request.Param.IssueAddress = TESTNET_ADDRESS; request.Param.MetaData.AssetName = "Test"; //request.Param.MetaData.Verification = new Colu.Models.IssueAsset.Verification(); //request.Param.MetaData.Verification.Domain = new Colu.Models.IssueAsset.Domain() { url = "https://www.bitpoker.io/assets.txt" }; var actual = await client.IssueAsync(request); Assert.IsNotNull(actual); } }
public async Task Should_Issue_Asset_With_Metadata_And_Image() { using (Client client = new Client(HOST, USERNAME, PASSWORD)) { var request = new Colu.Models.IssueAsset.Request() { Id = Guid.NewGuid().ToString() }; request.Param.Amount = 10; request.Param.Divisibility = 0; request.Param.Reissueable = false; request.Param.IssueAddress = TESTNET_ADDRESS; request.Param.MetaData.AssetName = "General Fisheries Permit"; request.Param.MetaData.Issuer = "Queensland Government"; var iconUrl = new Colu.Models.IssueAsset.Url() { Name = "icon", MimeType = "image/png", url = "https://blockchainpermits.azurewebsites.net/images/Fishing-Licence2.png" }; request.Param.MetaData.Urls.Add(iconUrl); var actual = await client.IssueAsync(request); Assert.IsNotNull(actual); } }
public async Task Should_Issue_Asset_With_Metadata() { using (Client client = new Client(HOST, USERNAME, PASSWORD)) { var request = new Colu.Models.IssueAsset.Request() { Id = Guid.NewGuid().ToString() }; request.Param.Amount = 1000; request.Param.Divisibility = 0; request.Param.Reissueable = true; request.Param.IssueAddress = TESTNET_ADDRESS; request.Param.MetaData.AssetName = "General Fisheries Permit"; request.Param.MetaData.Issuer = "Queensland Government"; var actual = await client.IssueAsync(request); Assert.IsNotNull(actual); } }