@psf/bch-js 5.1.0 → 5.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/bch-js.js +0 -4
- package/src/psf-slp-indexer.js +46 -7
- package/src/slp/utils.js +1 -1
- package/src/utxo.js +219 -6
- package/test/integration/chains/abc/utxo-integration.js +5 -3
- package/test/integration/chains/bchn/psf-slp-indexer.integration.js +20 -4
- package/test/integration/chains/bchn/transaction-integration.js +28 -0
- package/test/integration/chains/bchn/utxo-integration.js +179 -78
- package/test/integration/transaction-integration.js +58 -56
- package/test/unit/fixtures/psf-slp-indexer-mock.js +37 -14
- package/test/unit/fixtures/utxo-mocks.js +205 -1
- package/test/unit/psf-slp-indexer.js +75 -0
- package/test/unit/utxo-unit.js +117 -7
- package/src/ninsight.js +0 -319
- package/test/unit/fixtures/ninsight-mock.js +0 -170
- package/test/unit/ninsight.js +0 -255
|
@@ -14,108 +14,209 @@ describe('#UTXO', () => {
|
|
|
14
14
|
if (process.env.IS_USING_FREE_TIER) await sleep(3000)
|
|
15
15
|
})
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
if (process.env.TESTSLP) {
|
|
18
|
+
describe('#getOld', () => {
|
|
19
|
+
it('should get hydrated and filtered UTXOs for an address', async () => {
|
|
20
|
+
// const addr = 'bitcoincash:qqh793x9au6ehvh7r2zflzguanlme760wuzehgzjh9'
|
|
21
|
+
const addr = 'simpleledger:qzv3zz2trz0xgp6a96lu4m6vp2nkwag0kvyucjzqt9'
|
|
22
|
+
|
|
23
|
+
const result = await bchjs.Utxo.getOld(addr)
|
|
24
|
+
// console.log(`result: ${JSON.stringify(result, null, 2)}`)
|
|
25
|
+
|
|
26
|
+
assert.isArray(result)
|
|
27
|
+
assert.property(result[0], 'address')
|
|
28
|
+
assert.property(result[0], 'bchUtxos')
|
|
29
|
+
assert.property(result[0], 'nullUtxos')
|
|
30
|
+
assert.property(result[0], 'slpUtxos')
|
|
31
|
+
assert.isArray(result[0].bchUtxos)
|
|
32
|
+
assert.isArray(result[0].nullUtxos)
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
it('should handle an array of addresses', async () => {
|
|
36
|
+
const addr = [
|
|
37
|
+
'simpleledger:qzv3zz2trz0xgp6a96lu4m6vp2nkwag0kvyucjzqt9',
|
|
38
|
+
'bitcoincash:qqh793x9au6ehvh7r2zflzguanlme760wuzehgzjh9'
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
const result = await bchjs.Utxo.getOld(addr)
|
|
42
|
+
// console.log(`result: ${JSON.stringify(result, null, 2)}`)
|
|
43
|
+
|
|
44
|
+
assert.isArray(result)
|
|
45
|
+
assert.property(result[0], 'address')
|
|
46
|
+
assert.property(result[0], 'bchUtxos')
|
|
47
|
+
assert.property(result[0], 'nullUtxos')
|
|
48
|
+
assert.property(result[0], 'slpUtxos')
|
|
49
|
+
assert.isArray(result[0].bchUtxos)
|
|
50
|
+
assert.isArray(result[0].nullUtxos)
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
it('should handle NFTs and minting batons', async () => {
|
|
54
|
+
const addr = 'simpleledger:qrm0c67wwqh0w7wjxua2gdt2xggnm90xwsr5k22euj'
|
|
55
|
+
|
|
56
|
+
const result = await bchjs.Utxo.getOld(addr)
|
|
57
|
+
// console.log(`result: ${JSON.stringify(result, null, 2)}`)
|
|
58
|
+
|
|
59
|
+
assert.isArray(result)
|
|
60
|
+
assert.property(result[0], 'address')
|
|
61
|
+
assert.property(result[0], 'bchUtxos')
|
|
62
|
+
assert.property(result[0], 'nullUtxos')
|
|
63
|
+
assert.property(result[0], 'slpUtxos')
|
|
64
|
+
assert.isArray(result[0].bchUtxos)
|
|
65
|
+
assert.isArray(result[0].nullUtxos)
|
|
66
|
+
|
|
67
|
+
assert.isArray(result[0].slpUtxos.type1.mintBatons)
|
|
68
|
+
assert.isArray(result[0].slpUtxos.type1.tokens)
|
|
69
|
+
assert.isArray(result[0].slpUtxos.nft.groupMintBatons)
|
|
70
|
+
assert.isArray(result[0].slpUtxos.nft.groupTokens)
|
|
71
|
+
assert.isArray(result[0].slpUtxos.nft.tokens)
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
it('should use the whitelist when flag is set', async () => {
|
|
75
|
+
const addr = 'simpleledger:qzv3zz2trz0xgp6a96lu4m6vp2nkwag0kvyucjzqt9'
|
|
76
|
+
const useWhitelist = true
|
|
77
|
+
|
|
78
|
+
const result = await bchjs.Utxo.getOld(addr, useWhitelist)
|
|
79
|
+
// console.log(`result: ${JSON.stringify(result, null, 2)}`)
|
|
80
|
+
|
|
81
|
+
assert.isArray(result)
|
|
82
|
+
assert.property(result[0], 'address')
|
|
83
|
+
assert.property(result[0], 'bchUtxos')
|
|
84
|
+
assert.property(result[0], 'nullUtxos')
|
|
85
|
+
assert.property(result[0], 'slpUtxos')
|
|
86
|
+
assert.isArray(result[0].bchUtxos)
|
|
87
|
+
assert.isArray(result[0].nullUtxos)
|
|
88
|
+
|
|
89
|
+
// Most token UTXOs should end up in the nullUtxos array.
|
|
90
|
+
assert.isAbove(result[0].bchUtxos.length, 0)
|
|
91
|
+
assert.isAbove(result[0].nullUtxos.length, 1)
|
|
92
|
+
})
|
|
93
|
+
})
|
|
21
94
|
|
|
22
|
-
|
|
23
|
-
|
|
95
|
+
describe('#findBiggestUtxo', () => {
|
|
96
|
+
it('should sort UTXOs from Electrumx', async () => {
|
|
97
|
+
const addr = 'bitcoincash:qq54fgjn3hz0357n8a6guy4demw9xfkjk5jcj0xr0z'
|
|
24
98
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
assert.property(result[0], 'bchUtxos')
|
|
28
|
-
assert.property(result[0], 'nullUtxos')
|
|
29
|
-
assert.property(result[0], 'slpUtxos')
|
|
30
|
-
assert.isArray(result[0].bchUtxos)
|
|
31
|
-
assert.isArray(result[0].nullUtxos)
|
|
32
|
-
})
|
|
99
|
+
const electrumxUtxos = await bchjs.Electrumx.utxo(addr)
|
|
100
|
+
// console.log(`Electrumx utxos: ${JSON.stringify(electrumxUtxos, null, 2)}`)
|
|
33
101
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
'simpleledger:qzv3zz2trz0xgp6a96lu4m6vp2nkwag0kvyucjzqt9',
|
|
37
|
-
'bitcoincash:qqh793x9au6ehvh7r2zflzguanlme760wuzehgzjh9'
|
|
38
|
-
]
|
|
102
|
+
const result = bchjs.Utxo.findBiggestUtxo(electrumxUtxos.utxos)
|
|
103
|
+
// console.log(`result: ${JSON.stringify(result, null, 2)}`)
|
|
39
104
|
|
|
40
|
-
|
|
41
|
-
|
|
105
|
+
assert.property(result, 'satoshis')
|
|
106
|
+
assert.equal(result.satoshis, 800)
|
|
107
|
+
})
|
|
42
108
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
assert.property(result[0], 'bchUtxos')
|
|
46
|
-
assert.property(result[0], 'nullUtxos')
|
|
47
|
-
assert.property(result[0], 'slpUtxos')
|
|
48
|
-
assert.isArray(result[0].bchUtxos)
|
|
49
|
-
assert.isArray(result[0].nullUtxos)
|
|
50
|
-
})
|
|
109
|
+
it('should sort UTXOs from Utxos.get()', async () => {
|
|
110
|
+
const addr = 'bitcoincash:qq54fgjn3hz0357n8a6guy4demw9xfkjk5jcj0xr0z'
|
|
51
111
|
|
|
52
|
-
|
|
53
|
-
|
|
112
|
+
const utxos = await bchjs.Utxo.getOld(addr)
|
|
113
|
+
// console.log(`utxos: ${JSON.stringify(utxos, null, 2)}`)
|
|
54
114
|
|
|
55
|
-
|
|
56
|
-
|
|
115
|
+
const result = bchjs.Utxo.findBiggestUtxo(utxos[0].bchUtxos)
|
|
116
|
+
// console.log(`result: ${JSON.stringify(result, null, 2)}`)
|
|
57
117
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
assert.property(result[0], 'nullUtxos')
|
|
62
|
-
assert.property(result[0], 'slpUtxos')
|
|
63
|
-
assert.isArray(result[0].bchUtxos)
|
|
64
|
-
assert.isArray(result[0].nullUtxos)
|
|
65
|
-
|
|
66
|
-
assert.isArray(result[0].slpUtxos.type1.mintBatons)
|
|
67
|
-
assert.isArray(result[0].slpUtxos.type1.tokens)
|
|
68
|
-
assert.isArray(result[0].slpUtxos.nft.groupMintBatons)
|
|
69
|
-
assert.isArray(result[0].slpUtxos.nft.groupTokens)
|
|
70
|
-
assert.isArray(result[0].slpUtxos.nft.tokens)
|
|
118
|
+
assert.property(result, 'satoshis')
|
|
119
|
+
assert.equal(result.satoshis, 800)
|
|
120
|
+
})
|
|
71
121
|
})
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
describe('#hydrateTokenData', () => {
|
|
125
|
+
it('should hydrate token UTXOs', async () => {
|
|
126
|
+
const utxos = [
|
|
127
|
+
{
|
|
128
|
+
txid:
|
|
129
|
+
'384e1b8197e8de7d38f98317af2cf5f6bcb50007c46943b3498a6fab6e8aeb7c',
|
|
130
|
+
vout: 1,
|
|
131
|
+
type: 'token',
|
|
132
|
+
qty: '10000000',
|
|
133
|
+
tokenId:
|
|
134
|
+
'a436c8e1b6bee3d701c6044d190f76f774be83c36de8d34a988af4489e86dd37',
|
|
135
|
+
address: 'bitcoincash:qzv3zz2trz0xgp6a96lu4m6vp2nkwag0kvg8nfhq4m'
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
txid:
|
|
139
|
+
'4fc789405d58ec612c69eba29aa56cf0c7f228349801114138424eb68df4479d',
|
|
140
|
+
vout: 1,
|
|
141
|
+
type: 'token',
|
|
142
|
+
qty: '100000000',
|
|
143
|
+
tokenId:
|
|
144
|
+
'df808a41672a0a0ae6475b44f272a107bc9961b90f29dc918d71301f24fe92fb',
|
|
145
|
+
address: 'bitcoincash:qzv3zz2trz0xgp6a96lu4m6vp2nkwag0kvg8nfhq4m'
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
txid:
|
|
149
|
+
'42054bba4d69bfe7801ece0cffc754194b04239034fdfe9dbe321ef76c9a2d93',
|
|
150
|
+
vout: 5,
|
|
151
|
+
type: 'token',
|
|
152
|
+
qty: '4764',
|
|
153
|
+
tokenId:
|
|
154
|
+
'f05faf13a29c7f5e54ab921750aafb6afaa953db863bd2cf432e918661d4132f',
|
|
155
|
+
address: 'bitcoincash:qzv3zz2trz0xgp6a96lu4m6vp2nkwag0kvg8nfhq4m'
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
txid:
|
|
159
|
+
'06938d0a0d15aa76524ffe61fe111d6d2b2ea9dd8dcd4c7c7744614ced370861',
|
|
160
|
+
vout: 5,
|
|
161
|
+
type: 'token',
|
|
162
|
+
qty: '238',
|
|
163
|
+
tokenId:
|
|
164
|
+
'f05faf13a29c7f5e54ab921750aafb6afaa953db863bd2cf432e918661d4132f',
|
|
165
|
+
address: 'bitcoincash:qzv3zz2trz0xgp6a96lu4m6vp2nkwag0kvg8nfhq4m'
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
|
|
169
|
+
const result = await bchjs.Utxo.hydrateTokenData(utxos)
|
|
170
|
+
// console.log('result: ', result)
|
|
72
171
|
|
|
73
|
-
|
|
172
|
+
assert.property(result[0], 'ticker')
|
|
173
|
+
assert.property(result[0], 'name')
|
|
174
|
+
assert.property(result[0], 'qtyStr')
|
|
175
|
+
assert.property(result[0], 'documentUri')
|
|
176
|
+
assert.property(result[0], 'documentHash')
|
|
177
|
+
})
|
|
178
|
+
})
|
|
179
|
+
|
|
180
|
+
describe('#get', () => {
|
|
181
|
+
it('should hydrate address with BCH and SLP UTXOs', async () => {
|
|
74
182
|
const addr = 'simpleledger:qzv3zz2trz0xgp6a96lu4m6vp2nkwag0kvyucjzqt9'
|
|
75
|
-
const useWhitelist = true
|
|
76
183
|
|
|
77
|
-
const result = await bchjs.Utxo.get(addr
|
|
184
|
+
const result = await bchjs.Utxo.get(addr)
|
|
78
185
|
// console.log(`result: ${JSON.stringify(result, null, 2)}`)
|
|
79
186
|
|
|
80
|
-
|
|
81
|
-
assert.property(result
|
|
82
|
-
assert.property(result
|
|
83
|
-
assert.property(result
|
|
84
|
-
assert.property(result
|
|
85
|
-
assert.
|
|
86
|
-
assert.
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
assert.isAbove(result
|
|
90
|
-
assert.
|
|
187
|
+
// Assert expected properties exist.
|
|
188
|
+
assert.property(result, 'address')
|
|
189
|
+
assert.property(result, 'bchUtxos')
|
|
190
|
+
assert.property(result, 'slpUtxos')
|
|
191
|
+
assert.property(result.slpUtxos, 'type1')
|
|
192
|
+
assert.property(result.slpUtxos, 'nft')
|
|
193
|
+
assert.property(result, 'nullUtxos')
|
|
194
|
+
|
|
195
|
+
assert.isAbove(result.bchUtxos.length, 0)
|
|
196
|
+
assert.isAbove(result.slpUtxos.type1.tokens.length, 0)
|
|
197
|
+
assert.equal(result.slpUtxos.type1.mintBatons.length, 0)
|
|
91
198
|
})
|
|
92
|
-
})
|
|
93
|
-
|
|
94
|
-
describe('#findBiggestUtxo', () => {
|
|
95
|
-
it('should sort UTXOs from Electrumx', async () => {
|
|
96
|
-
const addr = 'bitcoincash:qq54fgjn3hz0357n8a6guy4demw9xfkjk5jcj0xr0z'
|
|
97
199
|
|
|
98
|
-
|
|
99
|
-
|
|
200
|
+
// TODO: NFTs are currently not identified as different than normal BCH UTXOs.
|
|
201
|
+
// The psf-slp-indexer needs to be updated to fix this issue.
|
|
202
|
+
it('should handle NFTs and minting batons', async () => {
|
|
203
|
+
const addr = 'simpleledger:qrm0c67wwqh0w7wjxua2gdt2xggnm90xwsr5k22euj'
|
|
100
204
|
|
|
101
|
-
const result = bchjs.Utxo.
|
|
205
|
+
const result = await bchjs.Utxo.get(addr)
|
|
102
206
|
// console.log(`result: ${JSON.stringify(result, null, 2)}`)
|
|
103
207
|
|
|
104
|
-
|
|
105
|
-
assert.
|
|
208
|
+
// Assert that minting batons are correctly identified.
|
|
209
|
+
assert.isAbove(result.slpUtxos.type1.mintBatons.length, 0)
|
|
106
210
|
})
|
|
107
211
|
|
|
108
|
-
it('should
|
|
109
|
-
const addr = 'bitcoincash:
|
|
110
|
-
|
|
111
|
-
const utxos = await bchjs.Utxo.get(addr)
|
|
112
|
-
// console.log(`utxos: ${JSON.stringify(utxos, null, 2)}`)
|
|
212
|
+
it('should return UTXOs for address with no SLP tokens', async () => {
|
|
213
|
+
const addr = 'bitcoincash:qp3sn6vlwz28ntmf3wmyra7jqttfx7z6zgtkygjhc7'
|
|
113
214
|
|
|
114
|
-
const result = bchjs.Utxo.
|
|
215
|
+
const result = await bchjs.Utxo.get(addr)
|
|
115
216
|
// console.log(`result: ${JSON.stringify(result, null, 2)}`)
|
|
116
217
|
|
|
117
|
-
assert.
|
|
118
|
-
assert.equal(result.
|
|
218
|
+
assert.isAbove(result.bchUtxos.length, 0)
|
|
219
|
+
assert.equal(result.slpUtxos.type1.tokens.length, 0)
|
|
119
220
|
})
|
|
120
221
|
})
|
|
121
222
|
})
|
|
@@ -11,72 +11,74 @@ describe('#Transaction', () => {
|
|
|
11
11
|
if (process.env.IS_USING_FREE_TIER) await bchjs.Util.sleep(1000)
|
|
12
12
|
})
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
if (process.env.TESTSLP) {
|
|
15
|
+
describe('#getOld', () => {
|
|
16
|
+
it('should get details about a non-SLP transaction', async () => {
|
|
17
|
+
const txid =
|
|
18
|
+
'2b37bdb3b63dd0bca720437754a36671431a950e684b64c44ea910ea9d5297c7'
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
const result = await bchjs.Transaction.getOld(txid)
|
|
21
|
+
// console.log(`result: ${JSON.stringify(result, null, 2)}`)
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
// Assert that there are stanardized properties.
|
|
24
|
+
assert.property(result, 'txid')
|
|
25
|
+
assert.property(result, 'vin')
|
|
26
|
+
assert.property(result, 'vout')
|
|
27
|
+
assert.property(result.vout[0], 'value')
|
|
28
|
+
assert.property(result.vout[0].scriptPubKey, 'addresses')
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
// Assert that added properties exist.
|
|
31
|
+
assert.property(result.vin[0], 'address')
|
|
32
|
+
assert.property(result.vin[0], 'value')
|
|
33
|
+
assert.property(result, 'isValidSLPTx')
|
|
34
|
+
assert.equal(result.isValidSLPTx, false)
|
|
35
|
+
})
|
|
35
36
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
it('should get details about a SLP transaction', async () => {
|
|
38
|
+
const txid =
|
|
39
|
+
'266844d53e46bbd7dd37134688dffea6e54d944edff27a0add63dd0908839bc1'
|
|
39
40
|
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
const result = await bchjs.Transaction.getOld(txid)
|
|
42
|
+
// console.log(`result: ${JSON.stringify(result, null, 2)}`)
|
|
42
43
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
// Assert that there are stanardized properties.
|
|
45
|
+
assert.property(result, 'txid')
|
|
46
|
+
assert.property(result, 'vin')
|
|
47
|
+
assert.property(result, 'vout')
|
|
48
|
+
assert.property(result.vout[0], 'value')
|
|
49
|
+
assert.property(result.vout[1].scriptPubKey, 'addresses')
|
|
49
50
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
51
|
+
// Assert that added properties exist.
|
|
52
|
+
assert.property(result.vout[0], 'tokenQty')
|
|
53
|
+
assert.equal(result.vout[0].tokenQty, null)
|
|
54
|
+
assert.property(result.vin[0], 'address')
|
|
55
|
+
assert.property(result.vin[0], 'value')
|
|
56
|
+
assert.property(result.vin[0], 'tokenQty')
|
|
57
|
+
assert.property(result, 'isValidSLPTx')
|
|
58
|
+
assert.equal(result.isValidSLPTx, true)
|
|
59
|
+
})
|
|
59
60
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
// it('should get problematic transaction', async () => {
|
|
62
|
+
// const txid = 'a55515de32577e296c512840bcaabed5823bb773fb4f8fd8e5197cc96cbc54d1'
|
|
63
|
+
//
|
|
64
|
+
// const result = await bchjs.Transaction.get(txid)
|
|
65
|
+
// console.log(`result: ${JSON.stringify(result, null, 2)}`)
|
|
66
|
+
// })
|
|
66
67
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
68
|
+
// TX a19f2f395a8b0e15b6202944c56834367d128f1e3630486a4756de53424a46fe has
|
|
69
|
+
// an input TXID (bd84bc1dd5ecd976165892306992401272f6bedeb37d7b2cdbf74fc4a55967a6)
|
|
70
|
+
// that is also a valid SLP tx, but is unrelated. Both TXs pass DAG validation,
|
|
71
|
+
// but for separate tokens.
|
|
72
|
+
it('should get problematic transaction', async () => {
|
|
73
|
+
const txid =
|
|
74
|
+
'a19f2f395a8b0e15b6202944c56834367d128f1e3630486a4756de53424a46fe'
|
|
74
75
|
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
const result = await bchjs.Transaction.getOld(txid)
|
|
77
|
+
// console.log(`result: ${JSON.stringify(result, null, 2)}`)
|
|
77
78
|
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
// The token ID should equal the txid for this Vin.
|
|
80
|
+
assert.equal(result.vin[2].txid, result.vin[2].tokenId)
|
|
81
|
+
})
|
|
80
82
|
})
|
|
81
|
-
}
|
|
83
|
+
}
|
|
82
84
|
})
|
|
@@ -21,7 +21,8 @@ const tokenStats = {
|
|
|
21
21
|
totalMinted: '1',
|
|
22
22
|
txs: [
|
|
23
23
|
{
|
|
24
|
-
txid:
|
|
24
|
+
txid:
|
|
25
|
+
'13cad617d523c8eb4ab11fff19c010e0e0a4ea4360b58e0c8c955a45a146a669',
|
|
25
26
|
height: 722420,
|
|
26
27
|
type: 'GENESIS',
|
|
27
28
|
qty: '1'
|
|
@@ -39,11 +40,14 @@ const txData = {
|
|
|
39
40
|
locktime: 0,
|
|
40
41
|
vin: [
|
|
41
42
|
{
|
|
42
|
-
txid:
|
|
43
|
+
txid:
|
|
44
|
+
'8370db30d94761ab9a11b71ecd22541151bf6125c8c613f0f6fab8ab794565a7',
|
|
43
45
|
vout: 0,
|
|
44
46
|
scriptSig: {
|
|
45
|
-
asm:
|
|
46
|
-
|
|
47
|
+
asm:
|
|
48
|
+
'304402207e9631c53dfc8a9a793d1916469628c6b7c5780c01c2f676d51ef21b0ba4926f022069feb471ec869a49f8d108d0aaba04e7cd36e60a7500109d86537f55698930d4[ALL|FORKID] 02791b19a39165dbd83403d6df268d44fd621da30581b0b6e5cb15a7101ed58851',
|
|
49
|
+
hex:
|
|
50
|
+
'47304402207e9631c53dfc8a9a793d1916469628c6b7c5780c01c2f676d51ef21b0ba4926f022069feb471ec869a49f8d108d0aaba04e7cd36e60a7500109d86537f55698930d4412102791b19a39165dbd83403d6df268d44fd621da30581b0b6e5cb15a7101ed58851'
|
|
47
51
|
},
|
|
48
52
|
sequence: 4294967295,
|
|
49
53
|
address: 'bitcoincash:qpvsg9vl9a5mlf37a7n3yce6pktdctn73qwgaqm3wq',
|
|
@@ -58,16 +62,20 @@ const txData = {
|
|
|
58
62
|
value: 0,
|
|
59
63
|
n: 0,
|
|
60
64
|
scriptPubKey: {
|
|
61
|
-
asm:
|
|
62
|
-
|
|
65
|
+
asm:
|
|
66
|
+
'OP_RETURN 5262419 1 47454e45534953 54524f5554 54726f75742773207465737420746f6b656e 74726f757473626c6f672e636f6d 0 2 2 000000174876e800',
|
|
67
|
+
hex:
|
|
68
|
+
'6a04534c500001010747454e455349530554524f55541254726f75742773207465737420746f6b656e0e74726f757473626c6f672e636f6d4c000102010208000000174876e800',
|
|
63
69
|
type: 'nulldata'
|
|
64
70
|
},
|
|
65
71
|
tokenQtyStr: '0',
|
|
66
72
|
tokenQty: 0
|
|
67
73
|
}
|
|
68
74
|
],
|
|
69
|
-
hex:
|
|
70
|
-
|
|
75
|
+
hex:
|
|
76
|
+
'0200000001a7654579abb8faf6f013c6c82561bf51115422cd1eb7119aab6147d930db7083000000006a47304402207e9631c53dfc8a9a793d1916469628c6b7c5780c01c2f676d51ef21b0ba4926f022069feb471ec869a49f8d108d0aaba04e7cd36e60a7500109d86537f55698930d4412102791b19a39165dbd83403d6df268d44fd621da30581b0b6e5cb15a7101ed58851ffffffff040000000000000000476a04534c500001010747454e455349530554524f55541254726f75742773207465737420746f6b656e0e74726f757473626c6f672e636f6d4c000102010208000000174876e80022020000000000001976a914db4d39ceb7794ffe5d06855f249e1d3a7f1b024088ac22020000000000001976a914db4d39ceb7794ffe5d06855f249e1d3a7f1b024088accec20000000000001976a9145904159f2f69bfa63eefa712633a0d96dc2e7e8888ac00000000',
|
|
77
|
+
blockhash:
|
|
78
|
+
'0000000000000000009f65225a3e12e23a7ea057c869047e0f36563a1f410267',
|
|
71
79
|
confirmations: 97398,
|
|
72
80
|
time: 1581773131,
|
|
73
81
|
blocktime: 1581773131,
|
|
@@ -88,27 +96,32 @@ const balance = {
|
|
|
88
96
|
balance: {
|
|
89
97
|
utxos: [
|
|
90
98
|
{
|
|
91
|
-
txid:
|
|
99
|
+
txid:
|
|
100
|
+
'a24a6a4abf06fabd799ecea4f8fac6a9ff21e6a8dd6169a3c2ebc03665329db9',
|
|
92
101
|
vout: 1,
|
|
93
102
|
type: 'token',
|
|
94
103
|
qty: '1800',
|
|
95
|
-
tokenId:
|
|
104
|
+
tokenId:
|
|
105
|
+
'a4fb5c2da1aa064e25018a43f9165040071d9e984ba190c222a7f59053af84b2',
|
|
96
106
|
address: 'bitcoincash:qrqy3kj7r822ps6628vwqq5k8hyjl6ey3y4eea2m4s'
|
|
97
107
|
}
|
|
98
108
|
],
|
|
99
109
|
txs: [
|
|
100
110
|
{
|
|
101
|
-
txid:
|
|
111
|
+
txid:
|
|
112
|
+
'078b2c48ed1db0d5d5996f2889b8d847a49200d0a781f6aa6752f740f312688f',
|
|
102
113
|
height: 717796
|
|
103
114
|
},
|
|
104
115
|
{
|
|
105
|
-
txid:
|
|
116
|
+
txid:
|
|
117
|
+
'a24a6a4abf06fabd799ecea4f8fac6a9ff21e6a8dd6169a3c2ebc03665329db9',
|
|
106
118
|
height: 717832
|
|
107
119
|
}
|
|
108
120
|
],
|
|
109
121
|
balances: [
|
|
110
122
|
{
|
|
111
|
-
tokenId:
|
|
123
|
+
tokenId:
|
|
124
|
+
'a4fb5c2da1aa064e25018a43f9165040071d9e984ba190c222a7f59053af84b2',
|
|
112
125
|
qty: '1800'
|
|
113
126
|
}
|
|
114
127
|
]
|
|
@@ -122,9 +135,19 @@ const status = {
|
|
|
122
135
|
chainBlockHeight: 722679
|
|
123
136
|
}
|
|
124
137
|
}
|
|
138
|
+
|
|
139
|
+
const tokenData01 = {
|
|
140
|
+
tokenType: 1,
|
|
141
|
+
txType: 'MINT',
|
|
142
|
+
tokenId: 'dd21be4532d93661e8ffe16db6535af0fb8ee1344d1fef81a193e2b4cfa9fbc9',
|
|
143
|
+
mintBatonVout: 2,
|
|
144
|
+
qty: {}
|
|
145
|
+
}
|
|
146
|
+
|
|
125
147
|
module.exports = {
|
|
126
148
|
tokenStats,
|
|
127
149
|
txData,
|
|
128
150
|
balance,
|
|
129
|
-
status
|
|
151
|
+
status,
|
|
152
|
+
tokenData01
|
|
130
153
|
}
|