forked from smartcontractkit/external-adapters-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfixtures.ts
128 lines (126 loc) · 3.98 KB
/
fixtures.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
import nock from 'nock'
export function mockBalanceResponse(): nock.Scope {
return nock('https://chain.api.btc.com:443', { encodedQueryParams: true })
.get('/v3/address/3EyjZ6CtEZEKyc719NZMyWaJpJG5jsVJL1')
.reply(
200,
{
data: {
address: '3EyjZ6CtEZEKyc719NZMyWaJpJG5jsVJL1',
received: 357176196514,
sent: 357176196514,
balance: 0,
tx_count: 63,
unconfirmed_tx_count: 0,
unconfirmed_received: 0,
unconfirmed_sent: 0,
unspent_tx_count: 0,
first_tx: 'd542926e85a98302a1b3af88a88ae55364696f230ea909e45fe20ce0fefe33d1',
last_tx: '4df75d3ef0f0e13cfd00625ded80b278e76475d4a73884d245edcb42c2814556',
},
err_code: 0,
err_no: 0,
message: 'success',
status: 'success',
},
[
'Date',
'Mon, 15 Nov 2021 16:14:53 GMT',
'Content-Type',
'application/json; charset=utf-8',
'Content-Length',
'437',
'Connection',
'close',
'Vary',
'Accept-Encoding',
'Access-Control-Allow-Origin',
'*',
'Access-Control-Allow-Credentials',
'true',
'Access-Control-Allow-Methods',
'GET, PUT, POST, DELETE, PATCH, OPTIONS',
'Access-Control-Allow-Headers',
'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization',
'Server',
'BTC.com',
'X-Frame-Options',
'SAMEORIGIN',
'X-XSS-Protection',
'1; mode=block',
'X-Content-Type-Options',
'nosniff',
'Strict-Transport-Security',
'max-age=63072000; includeSubDomains; preload',
],
)
}
export function mockBlockResponse(): nock.Scope {
return nock('https://chain.api.btc.com:443', { encodedQueryParams: true })
.get('/v3/block/latest')
.reply(
200,
{
data: {
height: 709857,
version: 671080448,
mrkl_root: 'a5b2db5e74c9f1866e3a62eae4bc645471b8ecc6fea8c452dace91d63e3836b9',
timestamp: 1636991861,
bits: 386689514,
nonce: 1647131200,
hash: '0000000000000000000964f8c9ae099170b0b1dfe6b3bf1a82edf15db1d2a847',
prev_block_hash: '00000000000000000000a750aef6a001b1b4f2202d46990700412f5fb59bf32f',
next_block_hash: '0000000000000000000000000000000000000000000000000000000000000000',
size: 1218365,
pool_difficulty: 29961509697911,
difficulty: 22674148233453,
difficulty_double: 22674148233453.105,
tx_count: 1771,
reward_block: 625000000,
reward_fees: 4006745,
confirmations: 1,
is_orphan: false,
curr_max_timestamp: 1636991861,
is_sw_block: true,
stripped_size: 716583,
sigops: 10655,
weight: 3368114,
extras: { pool_name: 'Binance Pool', pool_link: 'https://pool.binance.com/' },
},
err_code: 0,
err_no: 0,
message: 'success',
status: 'success',
},
[
'Date',
'Mon, 15 Nov 2021 16:18:23 GMT',
'Content-Type',
'application/json; charset=utf-8',
'Content-Length',
'889',
'Connection',
'close',
'Vary',
'Accept-Encoding',
'Access-Control-Allow-Origin',
'*',
'Access-Control-Allow-Credentials',
'true',
'Access-Control-Allow-Methods',
'GET, PUT, POST, DELETE, PATCH, OPTIONS',
'Access-Control-Allow-Headers',
'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization',
'Server',
'BTC.com',
'X-Frame-Options',
'SAMEORIGIN',
'X-XSS-Protection',
'1; mode=block',
'X-Content-Type-Options',
'nosniff',
'Strict-Transport-Security',
'max-age=63072000; includeSubDomains; preload',
],
)
}