feat(token-sweep): Added token sweep endpoint

This commit is contained in:
Chris Troutner
2019-10-28 09:48:10 -07:00
parent dc643d865a
commit 83d47bfda9
3 changed files with 358 additions and 18 deletions
+114 -2
View File
@@ -13,6 +13,118 @@ const mockAddress = {
isscript: false
}
module.exports = {
mockAddress
const mockBalance = {
page: 1,
totalPages: 1,
itemsOnPage: 1000,
address: "bitcoincash:qzp7gdl52edm24xlpkyqnza9rv33u3mdxyc77j3u6k",
balance: "2546",
totalReceived: "2546",
totalSent: "0",
unconfirmedBalance: "0",
unconfirmedTxs: 0,
txs: 2,
txids: [
"e190d13b88578132608ab912a4d2be3e55aa2792d6042d481ae21d700639de56",
"44e1f48c4093fc61db1a8fa206aa402fc34e482b3f788cb38c123ca0e1a35db6"
]
}
const mockUtxos = [
{
txid: "e190d13b88578132608ab912a4d2be3e55aa2792d6042d481ae21d700639de56",
vout: 0,
value: "2000",
height: 605873,
confirmations: 298,
satoshis: 2000
},
{
txid: "44e1f48c4093fc61db1a8fa206aa402fc34e482b3f788cb38c123ca0e1a35db6",
vout: 1,
value: "546",
height: 605873,
confirmations: 298,
satoshis: 546
}
]
const mockThreeUtxos = [
{
txid: "e190d13b88578132608ab912a4d2be3e55aa2792d6042d481ae21d700639de56",
vout: 0,
value: "2000",
height: 605873,
confirmations: 298,
satoshis: 2000
},
{
txid: "44e1f48c4093fc61db1a8fa206aa402fc34e482b3f788cb38c123ca0e1a35db6",
vout: 1,
value: "546",
height: 605873,
confirmations: 298,
satoshis: 546
},
{
txid: "44e1f48c4093fc61db1a8fa206aa402fc34e482b3f788cb38c123ca0e1a35db6",
vout: 1,
value: "546",
height: 605873,
confirmations: 298,
satoshis: 546
}
]
const mockIsTokenUtxos = [
false,
{
txid: "44e1f48c4093fc61db1a8fa206aa402fc34e482b3f788cb38c123ca0e1a35db6",
vout: 1,
value: "546",
height: 605873,
confirmations: 298,
satoshis: 546,
utxoType: "token",
transactionType: "send",
tokenId: "497291b8a1dfe69c8daea50677a3d31a5ef0e9484d8bebb610dac64bbc202fb7",
tokenTicker: "TOK-CH",
tokenName: "TokyoCash",
tokenDocumentUrl: "",
tokenDocumentHash: "",
decimals: 8,
tokenQty: 2
}
]
const tapUtxo = {
txid: "2e030df12390186baf817fa2760540b886511e04bc520e88f6b4c2124cc2a7d4",
vout: 1,
value: "546",
height: 606564,
confirmations: 3,
satoshis: 546,
utxoType: "token",
transactionType: "send",
tokenId: "dd84ca78db4d617221b58eabc6667af8fe2f7eadbfcc213d35be9f1b419beb8d",
tokenTicker: "TAP",
tokenName: "Thoughts and Prayers",
tokenDocumentUrl: "",
tokenDocumentHash: "",
decimals: 0,
tokenQty: 1
}
const tokensOnly = [mockIsTokenUtxos[1], tapUtxo]
const multipleTokens = [false, mockIsTokenUtxos[1], tapUtxo]
module.exports = {
mockAddress,
mockBalance,
mockUtxos,
mockThreeUtxos,
mockIsTokenUtxos,
tokensOnly,
multipleTokens
}