colored-coins / colored-coins-sdk Goto Github PK
View Code? Open in Web Editor NEWColored-Coins SDK for issuing and transferring digital assets using blockchain technology
Colored-Coins SDK for issuing and transferring digital assets using blockchain technology
colored-coins-sdk/lib/full_node.js
Lines 23 to 33 in 0e9c814
Sent 1 bitcoin and received this error because index at 1 was undefined.
var decimal = parts[1]
send json:
var send = {
from: [cc.hdwallet.getAddress(0, 0), fromAddress],
to: transferToAddresse,
fee: 1000,
financeChangeAddress: cc.hdwallet.getAddress(0, 0)
};
###There are something not right here.
- Json Argu properties:
{ address: [ ‘moNXJM8PytYgL3AWo7quuebnMbmyRoQKFD’ ],
utxos:
[ { index: 2,
txid: ‘25f3f5a5eb4127e733282b206bcf86d673c82422372708b8c44073dea85507fa’,
blocktime: 1497589000206,
blockheight: -1,
value: 64942400,
used: false,
scriptPubKey: [Object],
assets: [] } ] }
Its assets (cc.hdwallet.getAddress(0, 0)) become empty.
[
{
“assetId”: “Ua9XJuWCkUs1K8d6H8UtFtDu5ij8NRNaoY4pBK”,
“amount”: 100,
“issueTxid”: “7fa2c9a6c084b5f1c3b2b95341490b54ea0476f5dc970ceb25a512e8e01ad783”,
“divisibility”: 2,
“lockStatus”: false,
“aggregationPolicy”: “aggregatable”
}
],
[
{
“assetId”: “Ua9XJuWCkUs1K8d6H8UtFtDu5ij8NRNaoY4pBK”,
“amount”: 999890,
“issueTxid”: “ef62a80b878c6987ffb1747279b548ca3ffb786ddb620563fc7fc26ed54373c8",
“divisibility”: 2,
“lockStatus”: false,
“aggregationPolicy”: “aggregatable”
}
]
[
{
“assetId”: “Ua9XJuWCkUs1K8d6H8UtFtDu5ij8NRNaoY4pBK”,
“amount”: 100,
“issueTxid”: “8719ea7d187bfb00698087917d5300956094d432c1df981ecdc8eab9feb3f655”,
“divisibility”: 2,
“lockStatus”: false,
“aggregationPolicy”: “aggregatable”
}
],
[
{
“assetId”: “Ua9XJuWCkUs1K8d6H8UtFtDu5ij8NRNaoY4pBK”,
“amount”: 110,
“issueTxid”: “ef62a80b878c6987ffb1747279b548ca3ffb786ddb620563fc7fc26ed54373c8",
“divisibility”: 2,
“lockStatus”: false,
“aggregationPolicy”: “aggregatable”
}
]
from: [cc.hdwallet.getAddress(0, 0), fromAddress] I did use 2 address since the fromAddress did not have enough satoshi tBTC as u can see I set the financeChangeAddress: cc.hdwallet.getAddress(0, 0) to the same tBTC address every time therefore sending asset will spend only the small dust/tx fee.
Every thing work fine if the cc.hdwallet.getAddress(0, 0) hold zero amount in cc and I can use its tBTC value to help finance the tx in cc sdk for another address in cc(addresses with the same assetId).
And it happen the same to the BurnAsset!
To reproduce the bug:
After sent back and forth, the output amount (Funding amount in tBTC) will automatically go to address A in testnet even thought we set (financeChangeAddress to cc.hdwallet.getAddress(0, 0))
Note:
How do we configure the SDK to work with Hyperledger or MultiChain Private Block Chain.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.