本文整理汇总了Java中org.bitcoinj.script.Script.getToAddress方法的典型用法代码示例。如果您正苦于以下问题:Java Script.getToAddress方法的具体用法?Java Script.getToAddress怎么用?Java Script.getToAddress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bitcoinj.script.Script
的用法示例。
在下文中一共展示了Script.getToAddress方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getWalletAddressOfReceived
import org.bitcoinj.script.Script; //导入方法依赖的package包/类
@Nullable
public static Address getWalletAddressOfReceived(final Transaction tx, final Wallet wallet) {
for (final TransactionOutput output : tx.getOutputs()) {
try {
if (output.isMine(wallet)) {
final Script script = output.getScriptPubKey();
return script.getToAddress(Constants.NETWORK_PARAMETERS, true);
}
} catch (final ScriptException x) {
// swallow
}
}
return null;
}
示例2: getOutputAddress
import org.bitcoinj.script.Script; //导入方法依赖的package包/类
static Address getOutputAddress(TransactionOutput out) {
try {
Script script = out.getScriptPubKey();
if (script.isSentToAddress() || script.isPayToScriptHash()) {
return script.getToAddress(Constants.NETWORK_PARAMS);
}
} catch (ScriptException e) {
// TODO
//LOG.error("Error while reading transaction output address", e);
}
return null;
}
示例3: getToAddressOfSent
import org.bitcoinj.script.Script; //导入方法依赖的package包/类
@Nullable
public static Address getToAddressOfSent(final Transaction tx, final Wallet wallet) {
for (final TransactionOutput output : tx.getOutputs()) {
try {
if (!output.isMine(wallet)) {
final Script script = output.getScriptPubKey();
return script.getToAddress(Constants.NETWORK_PARAMETERS, true);
}
} catch (final ScriptException x) {
// swallow
}
}
return null;
}
示例4: getAddress
import org.bitcoinj.script.Script; //导入方法依赖的package包/类
public Address getAddress() {
if (!hasAddress())
throw new IllegalStateException();
final Script script = outputs[0].script;
return script.getToAddress(Constants.NETWORK_PARAMETERS, true);
}
示例5: from
import org.bitcoinj.script.Script; //导入方法依赖的package包/类
public static BitAddress from(CoinType type, Script script) throws AddressMalformedException {
try {
return new BitAddress(script.getToAddress(type));
} catch (WrongNetworkException e) {
throw new AddressMalformedException(e);
}
}
示例6: getMultisig2of2Address
import org.bitcoinj.script.Script; //导入方法依赖的package包/类
private Address getMultisig2of2Address() {
Script script = createMultisig2of2Script(clientKey, serverKey);
return script.getToAddress(appConfig.getNetworkParameters());
}