当前位置: 首页>>代码示例>>Java>>正文


Java BCSAPI类代码示例

本文整理汇总了Java中com.bitsofproof.supernode.api.BCSAPI的典型用法代码示例。如果您正苦于以下问题:Java BCSAPI类的具体用法?Java BCSAPI怎么用?Java BCSAPI使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


BCSAPI类属于com.bitsofproof.supernode.api包,在下文中一共展示了BCSAPI类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateTransaction

import com.bitsofproof.supernode.api.BCSAPI; //导入依赖的package包/类
public void updateTransaction (BCSAPI api, PendingTransaction transaction) throws BCSAPIException, ValidationException
{
	transaction.setSignedBy (getSignedBy (transaction.getTransaction ()));
	if ( transaction.getSignedBy ().size () > 0 )
	{
		pendingTransactions.put (transaction.getId (), transaction);
		try
		{
			transaction.getTransaction ().computeHash ();
			log.info ("Updated " + transaction.getId () + " to " + transaction.getTransaction ().getHash ());
			if ( getSignedBy (transaction.getTransaction ()).size () >= 2 )
			{
				api.sendTransaction (transaction.getTransaction ());
				log.info ("Successfully sent " + transaction.getTransaction ().getHash ());
				log.info ("transaction: " + transaction.getTransaction ().toWireDump ());
				pendingTransactions.remove (transaction.getId ());
			}
		}
		catch ( BCSAPIException e )
		{
			log.info ("Transaction rejected " + transaction.getTransaction ().getHash ());
			throw e;
		}
	}
}
 
开发者ID:bitsofproof,项目名称:btc1k,代码行数:26,代码来源:Vault.java

示例2: BopShopResource

import com.bitsofproof.supernode.api.BCSAPI; //导入依赖的package包/类
public BopShopResource (BCSAPI api, Vault vault, ExtendedKey master, int customerId, String password) throws ValidationException
{
	this.master = master;
	this.vault = vault;
	this.api = api;
	client = HttpClientBuilder.create ().build ();
	this.customerId = customerId;
	this.password = password;

	log.info ("Vault address is " + vault.getVaultAddress ());
}
 
开发者ID:bitsofproof,项目名称:btc1k,代码行数:12,代码来源:BopShopResource.java

示例3: run

import com.bitsofproof.supernode.api.BCSAPI; //导入依赖的package包/类
@Override
public void run (Btc1kConfiguration configuration, Environment environment) throws Exception
{
	BCSAPI api = supernodeBundle.getBCSAPI ();
	Vault vault = configuration.getVaultFactory ().createVault ();
	environment.lifecycle ().manage (new Btc1kService (api, vault));
	environment.jersey ().register (new BopShopResource (
			supernodeBundle.getBCSAPI (),
			vault,
			configuration.getBopShopKey (),
			configuration.getCustomerId (),
			configuration.getPassphrase ()
			).processCleared ());
}
 
开发者ID:bitsofproof,项目名称:btc1k,代码行数:15,代码来源:Btc1kApplication.java

示例4: sync

import com.bitsofproof.supernode.api.BCSAPI; //导入依赖的package包/类
@Override
public void sync (BCSAPI api) throws BCSAPIException
{
	reset ();
	api.scanUTXOForAddresses (getAddresses (), new TransactionListener ()
	{
		@Override
		public boolean process (Transaction t)
		{
			return updateWithTransaction (t);
		}
	});
}
 
开发者ID:bitsofproof,项目名称:btc1k,代码行数:14,代码来源:Vault.java

示例5: syncHistory

import com.bitsofproof.supernode.api.BCSAPI; //导入依赖的package包/类
@Override
public void syncHistory (BCSAPI api) throws BCSAPIException
{
	reset ();
	api.scanTransactionsForAddresses (getAddresses (), getCreated (), new TransactionListener ()
	{
		@Override
		public boolean process (Transaction t)
		{
			return updateWithTransaction (t);
		}
	});
}
 
开发者ID:bitsofproof,项目名称:btc1k,代码行数:14,代码来源:Vault.java

示例6: TransactionsResource

import com.bitsofproof.supernode.api.BCSAPI; //导入依赖的package包/类
public TransactionsResource (Vault vault, BCSAPI api)
{
	this.vault = vault;
	this.api = api;
}
 
开发者ID:bitsofproof,项目名称:btc1k,代码行数:6,代码来源:TransactionsResource.java

示例7: Btc1kService

import com.bitsofproof.supernode.api.BCSAPI; //导入依赖的package包/类
private Btc1kService (BCSAPI api, Vault vault)
{
	this.api = api;
	this.vault = vault;
}
 
开发者ID:bitsofproof,项目名称:btc1k,代码行数:6,代码来源:Btc1kApplication.java


注:本文中的com.bitsofproof.supernode.api.BCSAPI类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。