本文整理汇总了Python中btctxstore.BtcTxStore.splitutxos方法的典型用法代码示例。如果您正苦于以下问题:Python BtcTxStore.splitutxos方法的具体用法?Python BtcTxStore.splitutxos怎么用?Python BtcTxStore.splitutxos使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类btctxstore.BtcTxStore
的用法示例。
在下文中一共展示了BtcTxStore.splitutxos方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestSplitUtxos
# 需要导入模块: from btctxstore import BtcTxStore [as 别名]
# 或者: from btctxstore.BtcTxStore import splitutxos [as 别名]
class TestSplitUtxos(unittest.TestCase):
def setUp(self):
self.api = BtcTxStore(dryrun=True, testnet=True)
def test_singleinput(self):
wif = "cNHPbjVpkv4oqqKimBNp1UfQ2dhjETtRZw4KkHWtPgnU36SBtXub"
# address n4RHA7mxH8EYV7wMS8evtYRYwCpQYz6KuE
txids = self.api.splitutxos(wif, 10000000) # 100mBTC
print("TestSplitUtxos txids:", len(txids))
self.assertEqual(len(txids), 1)
def test_manyinputs(self):
wif = "cRoboMG5KM19VP8ZcVCDXGCfi1JJraKpw58ofe8v57j7vqDxaQ5m"
# address mqox6abLAiado9kFvX3EsHaVFbYVimSMCK
txids = self.api.splitutxos(wif, 100000) # 1mBTC
print("TestSplitUtxos txids:", len(txids))
self.assertEqual(len(txids), 6)
示例2: Copyright
# 需要导入模块: from btctxstore import BtcTxStore [as 别名]
# 或者: from btctxstore.BtcTxStore import splitutxos [as 别名]
#!/usr/bin/env python
# coding: utf-8
# Copyright (c) 2015 Fabian Barkhau <[email protected]>
# License: MIT (see LICENSE file)
from __future__ import print_function
from __future__ import unicode_literals
from btctxstore import BtcTxStore
# Please do not spend the testnet coins is this wallet
# or the example will fail due to lack of funds.
wif = "cUZfG8KJ3BrXneg2LjUX4VoMg76Fcgx6QDiAZj2oGbuw6da8Lzv1"
# use testnet and dont post tx to blockchain for example
api = BtcTxStore(testnet=True, dryrun=True)
limit = 10000000 # 0.1BTC
txids = api.splitutxos(wif, limit)
print(txids)