@secretkeylabs/stacks-tools 0.2.0 → 0.3.0-05c5288
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/dist/index.cjs +1090 -0
- package/dist/index.d.cts +661 -0
- package/dist/index.d.ts +661 -2
- package/dist/index.js +1052 -3
- package/package.json +13 -5
- package/dist/index.js.map +0 -1
- package/dist/pox4-api/burn-height-to-reward-cycle.d.ts +0 -7
- package/dist/pox4-api/burn-height-to-reward-cycle.js +0 -6
- package/dist/pox4-api/burn-height-to-reward-cycle.js.map +0 -1
- package/dist/pox4-api/current-pox-reward-cycle.d.ts +0 -1
- package/dist/pox4-api/current-pox-reward-cycle.js +0 -3
- package/dist/pox4-api/current-pox-reward-cycle.js.map +0 -1
- package/dist/pox4-api/get-stacker-info.d.ts +0 -1
- package/dist/pox4-api/get-stacker-info.js +0 -3
- package/dist/pox4-api/get-stacker-info.js.map +0 -1
- package/dist/pox4-api/reward-cycle-to-burn-height.d.ts +0 -1
- package/dist/pox4-api/reward-cycle-to-burn-height.js +0 -3
- package/dist/pox4-api/reward-cycle-to-burn-height.js.map +0 -1
- package/dist/queries/get-signer-total-locked.d.ts +0 -18
- package/dist/queries/get-signer-total-locked.js +0 -59
- package/dist/queries/get-signer-total-locked.js.map +0 -1
- package/dist/queries/index.d.ts +0 -4
- package/dist/queries/index.js +0 -5
- package/dist/queries/index.js.map +0 -1
- package/dist/stacks-api/accounts/balances.d.ts +0 -34
- package/dist/stacks-api/accounts/balances.js +0 -70
- package/dist/stacks-api/accounts/balances.js.map +0 -1
- package/dist/stacks-api/accounts/index.d.ts +0 -4
- package/dist/stacks-api/accounts/index.js +0 -5
- package/dist/stacks-api/accounts/index.js.map +0 -1
- package/dist/stacks-api/blocks/get-block.d.ts +0 -29
- package/dist/stacks-api/blocks/get-block.js +0 -62
- package/dist/stacks-api/blocks/get-block.js.map +0 -1
- package/dist/stacks-api/blocks/index.d.ts +0 -4
- package/dist/stacks-api/blocks/index.js +0 -5
- package/dist/stacks-api/blocks/index.js.map +0 -1
- package/dist/stacks-api/index.d.ts +0 -28
- package/dist/stacks-api/index.js +0 -17
- package/dist/stacks-api/index.js.map +0 -1
- package/dist/stacks-api/info/core-api.d.ts +0 -21
- package/dist/stacks-api/info/core-api.js +0 -55
- package/dist/stacks-api/info/core-api.js.map +0 -1
- package/dist/stacks-api/info/index.d.ts +0 -6
- package/dist/stacks-api/info/index.js +0 -7
- package/dist/stacks-api/info/index.js.map +0 -1
- package/dist/stacks-api/info/pox-details.d.ts +0 -59
- package/dist/stacks-api/info/pox-details.js +0 -92
- package/dist/stacks-api/info/pox-details.js.map +0 -1
- package/dist/stacks-api/proof-of-transfer/cycle.d.ts +0 -16
- package/dist/stacks-api/proof-of-transfer/cycle.js +0 -50
- package/dist/stacks-api/proof-of-transfer/cycle.js.map +0 -1
- package/dist/stacks-api/proof-of-transfer/cycles.d.ts +0 -37
- package/dist/stacks-api/proof-of-transfer/cycles.js +0 -61
- package/dist/stacks-api/proof-of-transfer/cycles.js.map +0 -1
- package/dist/stacks-api/proof-of-transfer/index.d.ts +0 -10
- package/dist/stacks-api/proof-of-transfer/index.js +0 -11
- package/dist/stacks-api/proof-of-transfer/index.js.map +0 -1
- package/dist/stacks-api/proof-of-transfer/signers-in-cycle.d.ts +0 -45
- package/dist/stacks-api/proof-of-transfer/signers-in-cycle.js +0 -66
- package/dist/stacks-api/proof-of-transfer/signers-in-cycle.js.map +0 -1
- package/dist/stacks-api/proof-of-transfer/stackers-for-signer-in-cycle.d.ts +0 -34
- package/dist/stacks-api/proof-of-transfer/stackers-for-signer-in-cycle.js +0 -59
- package/dist/stacks-api/proof-of-transfer/stackers-for-signer-in-cycle.js.map +0 -1
- package/dist/stacks-api/smart-contracts/index.d.ts +0 -4
- package/dist/stacks-api/smart-contracts/index.js +0 -5
- package/dist/stacks-api/smart-contracts/index.js.map +0 -1
- package/dist/stacks-api/smart-contracts/read-only.d.ts +0 -19
- package/dist/stacks-api/smart-contracts/read-only.js +0 -50
- package/dist/stacks-api/smart-contracts/read-only.js.map +0 -1
- package/dist/stacks-api/stacking-pool/index.d.ts +0 -4
- package/dist/stacks-api/stacking-pool/index.js +0 -5
- package/dist/stacks-api/stacking-pool/index.js.map +0 -1
- package/dist/stacks-api/stacking-pool/members.d.ts +0 -34
- package/dist/stacks-api/stacking-pool/members.js +0 -64
- package/dist/stacks-api/stacking-pool/members.js.map +0 -1
- package/dist/stacks-api/transactions/address-transactions.d.ts +0 -487
- package/dist/stacks-api/transactions/address-transactions.js +0 -75
- package/dist/stacks-api/transactions/address-transactions.js.map +0 -1
- package/dist/stacks-api/transactions/get-transaction.d.ts +0 -8
- package/dist/stacks-api/transactions/get-transaction.js +0 -42
- package/dist/stacks-api/transactions/get-transaction.js.map +0 -1
- package/dist/stacks-api/transactions/index.d.ts +0 -6
- package/dist/stacks-api/transactions/index.js +0 -7
- package/dist/stacks-api/transactions/index.js.map +0 -1
- package/dist/stacks-api/transactions/schemas.d.ts +0 -327
- package/dist/stacks-api/transactions/schemas.js +0 -85
- package/dist/stacks-api/transactions/schemas.js.map +0 -1
- package/dist/stacks-api/types.d.ts +0 -26
- package/dist/stacks-api/types.js +0 -8
- package/dist/stacks-api/types.js.map +0 -1
- package/dist/utils/call-rate-limited-api.d.ts +0 -8
- package/dist/utils/call-rate-limited-api.js +0 -28
- package/dist/utils/call-rate-limited-api.js.map +0 -1
- package/dist/utils/safe.d.ts +0 -10
- package/dist/utils/safe.js +0 -31
- package/dist/utils/safe.js.map +0 -1
|
@@ -1,487 +0,0 @@
|
|
|
1
|
-
import { type SafeError, type Result as SafeResult } from "../../utils/safe.js";
|
|
2
|
-
import { type ApiPaginationOptions, type ApiRequestOptions } from "../types.js";
|
|
3
|
-
import * as v from "valibot";
|
|
4
|
-
type Args = {
|
|
5
|
-
address: string;
|
|
6
|
-
} & ApiRequestOptions & ApiPaginationOptions;
|
|
7
|
-
declare const resultSchema: v.ObjectSchema<{
|
|
8
|
-
readonly tx: v.VariantSchema<"tx_type", [v.ObjectSchema<{
|
|
9
|
-
readonly tx_id: v.StringSchema<undefined>;
|
|
10
|
-
readonly nonce: v.NumberSchema<undefined>;
|
|
11
|
-
readonly fee_rate: v.StringSchema<undefined>;
|
|
12
|
-
readonly sender_address: v.StringSchema<undefined>;
|
|
13
|
-
readonly sponsored: v.BooleanSchema<undefined>;
|
|
14
|
-
readonly post_condition_mode: v.StringSchema<undefined>;
|
|
15
|
-
readonly post_conditions: v.ArraySchema<v.UnknownSchema, undefined>;
|
|
16
|
-
readonly anchor_mode: v.StringSchema<undefined>;
|
|
17
|
-
readonly is_unanchored: v.BooleanSchema<undefined>;
|
|
18
|
-
readonly block_hash: v.StringSchema<undefined>;
|
|
19
|
-
readonly parent_block_hash: v.StringSchema<undefined>;
|
|
20
|
-
readonly block_height: v.NumberSchema<undefined>;
|
|
21
|
-
readonly block_time: v.NumberSchema<undefined>;
|
|
22
|
-
readonly block_time_iso: v.StringSchema<undefined>;
|
|
23
|
-
readonly burn_block_height: v.NumberSchema<undefined>;
|
|
24
|
-
readonly burn_block_time: v.NumberSchema<undefined>;
|
|
25
|
-
readonly burn_block_time_iso: v.StringSchema<undefined>;
|
|
26
|
-
readonly parent_burn_block_time: v.NumberSchema<undefined>;
|
|
27
|
-
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
28
|
-
readonly canonical: v.BooleanSchema<undefined>;
|
|
29
|
-
readonly tx_index: v.NumberSchema<undefined>;
|
|
30
|
-
readonly tx_status: v.StringSchema<undefined>;
|
|
31
|
-
readonly tx_result: v.ObjectSchema<{
|
|
32
|
-
readonly hex: v.StringSchema<undefined>;
|
|
33
|
-
readonly repr: v.StringSchema<undefined>;
|
|
34
|
-
}, undefined>;
|
|
35
|
-
readonly microblock_hash: v.StringSchema<undefined>;
|
|
36
|
-
readonly microblock_sequence: v.NumberSchema<undefined>;
|
|
37
|
-
readonly microblock_canonical: v.BooleanSchema<undefined>;
|
|
38
|
-
readonly event_count: v.NumberSchema<undefined>;
|
|
39
|
-
readonly events: v.ArraySchema<v.UnknownSchema, undefined>;
|
|
40
|
-
readonly execution_cost_read_count: v.NumberSchema<undefined>;
|
|
41
|
-
readonly execution_cost_read_length: v.NumberSchema<undefined>;
|
|
42
|
-
readonly execution_cost_runtime: v.NumberSchema<undefined>;
|
|
43
|
-
readonly execution_cost_write_count: v.NumberSchema<undefined>;
|
|
44
|
-
readonly execution_cost_write_length: v.NumberSchema<undefined>;
|
|
45
|
-
readonly tx_type: v.LiteralSchema<"contract_call", undefined>;
|
|
46
|
-
readonly contract_call: v.ObjectSchema<{
|
|
47
|
-
readonly contract_id: v.StringSchema<undefined>;
|
|
48
|
-
readonly function_name: v.StringSchema<undefined>;
|
|
49
|
-
readonly function_signature: v.StringSchema<undefined>;
|
|
50
|
-
readonly function_args: v.ArraySchema<v.ObjectSchema<{
|
|
51
|
-
readonly hex: v.StringSchema<undefined>;
|
|
52
|
-
readonly repr: v.StringSchema<undefined>;
|
|
53
|
-
readonly name: v.StringSchema<undefined>;
|
|
54
|
-
readonly type: v.StringSchema<undefined>;
|
|
55
|
-
}, undefined>, undefined>;
|
|
56
|
-
}, undefined>;
|
|
57
|
-
}, undefined>, v.ObjectSchema<{
|
|
58
|
-
readonly tx_id: v.StringSchema<undefined>;
|
|
59
|
-
readonly nonce: v.NumberSchema<undefined>;
|
|
60
|
-
readonly fee_rate: v.StringSchema<undefined>;
|
|
61
|
-
readonly sender_address: v.StringSchema<undefined>;
|
|
62
|
-
readonly sponsored: v.BooleanSchema<undefined>;
|
|
63
|
-
readonly post_condition_mode: v.StringSchema<undefined>;
|
|
64
|
-
readonly post_conditions: v.ArraySchema<v.UnknownSchema, undefined>;
|
|
65
|
-
readonly anchor_mode: v.StringSchema<undefined>;
|
|
66
|
-
readonly is_unanchored: v.BooleanSchema<undefined>;
|
|
67
|
-
readonly block_hash: v.StringSchema<undefined>;
|
|
68
|
-
readonly parent_block_hash: v.StringSchema<undefined>;
|
|
69
|
-
readonly block_height: v.NumberSchema<undefined>;
|
|
70
|
-
readonly block_time: v.NumberSchema<undefined>;
|
|
71
|
-
readonly block_time_iso: v.StringSchema<undefined>;
|
|
72
|
-
readonly burn_block_height: v.NumberSchema<undefined>;
|
|
73
|
-
readonly burn_block_time: v.NumberSchema<undefined>;
|
|
74
|
-
readonly burn_block_time_iso: v.StringSchema<undefined>;
|
|
75
|
-
readonly parent_burn_block_time: v.NumberSchema<undefined>;
|
|
76
|
-
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
77
|
-
readonly canonical: v.BooleanSchema<undefined>;
|
|
78
|
-
readonly tx_index: v.NumberSchema<undefined>;
|
|
79
|
-
readonly tx_status: v.StringSchema<undefined>;
|
|
80
|
-
readonly tx_result: v.ObjectSchema<{
|
|
81
|
-
readonly hex: v.StringSchema<undefined>;
|
|
82
|
-
readonly repr: v.StringSchema<undefined>;
|
|
83
|
-
}, undefined>;
|
|
84
|
-
readonly microblock_hash: v.StringSchema<undefined>;
|
|
85
|
-
readonly microblock_sequence: v.NumberSchema<undefined>;
|
|
86
|
-
readonly microblock_canonical: v.BooleanSchema<undefined>;
|
|
87
|
-
readonly event_count: v.NumberSchema<undefined>;
|
|
88
|
-
readonly events: v.ArraySchema<v.UnknownSchema, undefined>;
|
|
89
|
-
readonly execution_cost_read_count: v.NumberSchema<undefined>;
|
|
90
|
-
readonly execution_cost_read_length: v.NumberSchema<undefined>;
|
|
91
|
-
readonly execution_cost_runtime: v.NumberSchema<undefined>;
|
|
92
|
-
readonly execution_cost_write_count: v.NumberSchema<undefined>;
|
|
93
|
-
readonly execution_cost_write_length: v.NumberSchema<undefined>;
|
|
94
|
-
readonly tx_type: v.LiteralSchema<"smart_contract", undefined>;
|
|
95
|
-
readonly smart_contract: v.ObjectSchema<{
|
|
96
|
-
readonly clarity_version: v.UnionSchema<[v.NullSchema<undefined>, v.NumberSchema<undefined>], undefined>;
|
|
97
|
-
readonly contract_id: v.StringSchema<undefined>;
|
|
98
|
-
readonly source_code: v.StringSchema<undefined>;
|
|
99
|
-
}, undefined>;
|
|
100
|
-
}, undefined>, v.ObjectSchema<{
|
|
101
|
-
readonly tx_id: v.StringSchema<undefined>;
|
|
102
|
-
readonly nonce: v.NumberSchema<undefined>;
|
|
103
|
-
readonly fee_rate: v.StringSchema<undefined>;
|
|
104
|
-
readonly sender_address: v.StringSchema<undefined>;
|
|
105
|
-
readonly sponsored: v.BooleanSchema<undefined>;
|
|
106
|
-
readonly post_condition_mode: v.StringSchema<undefined>;
|
|
107
|
-
readonly post_conditions: v.ArraySchema<v.UnknownSchema, undefined>;
|
|
108
|
-
readonly anchor_mode: v.StringSchema<undefined>;
|
|
109
|
-
readonly is_unanchored: v.BooleanSchema<undefined>;
|
|
110
|
-
readonly block_hash: v.StringSchema<undefined>;
|
|
111
|
-
readonly parent_block_hash: v.StringSchema<undefined>;
|
|
112
|
-
readonly block_height: v.NumberSchema<undefined>;
|
|
113
|
-
readonly block_time: v.NumberSchema<undefined>;
|
|
114
|
-
readonly block_time_iso: v.StringSchema<undefined>;
|
|
115
|
-
readonly burn_block_height: v.NumberSchema<undefined>;
|
|
116
|
-
readonly burn_block_time: v.NumberSchema<undefined>;
|
|
117
|
-
readonly burn_block_time_iso: v.StringSchema<undefined>;
|
|
118
|
-
readonly parent_burn_block_time: v.NumberSchema<undefined>;
|
|
119
|
-
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
120
|
-
readonly canonical: v.BooleanSchema<undefined>;
|
|
121
|
-
readonly tx_index: v.NumberSchema<undefined>;
|
|
122
|
-
readonly tx_status: v.StringSchema<undefined>;
|
|
123
|
-
readonly tx_result: v.ObjectSchema<{
|
|
124
|
-
readonly hex: v.StringSchema<undefined>;
|
|
125
|
-
readonly repr: v.StringSchema<undefined>;
|
|
126
|
-
}, undefined>;
|
|
127
|
-
readonly microblock_hash: v.StringSchema<undefined>;
|
|
128
|
-
readonly microblock_sequence: v.NumberSchema<undefined>;
|
|
129
|
-
readonly microblock_canonical: v.BooleanSchema<undefined>;
|
|
130
|
-
readonly event_count: v.NumberSchema<undefined>;
|
|
131
|
-
readonly events: v.ArraySchema<v.UnknownSchema, undefined>;
|
|
132
|
-
readonly execution_cost_read_count: v.NumberSchema<undefined>;
|
|
133
|
-
readonly execution_cost_read_length: v.NumberSchema<undefined>;
|
|
134
|
-
readonly execution_cost_runtime: v.NumberSchema<undefined>;
|
|
135
|
-
readonly execution_cost_write_count: v.NumberSchema<undefined>;
|
|
136
|
-
readonly execution_cost_write_length: v.NumberSchema<undefined>;
|
|
137
|
-
readonly tx_type: v.LiteralSchema<"token_transfer", undefined>;
|
|
138
|
-
readonly token_transfer: v.ObjectSchema<{
|
|
139
|
-
readonly recipient_address: v.StringSchema<undefined>;
|
|
140
|
-
readonly amount: v.StringSchema<undefined>;
|
|
141
|
-
readonly memo: v.StringSchema<undefined>;
|
|
142
|
-
}, undefined>;
|
|
143
|
-
}, undefined>], undefined>;
|
|
144
|
-
readonly stx_sent: v.StringSchema<undefined>;
|
|
145
|
-
readonly stx_received: v.StringSchema<undefined>;
|
|
146
|
-
readonly events: v.ObjectSchema<{
|
|
147
|
-
readonly stx: v.ObjectSchema<{
|
|
148
|
-
readonly transfer: v.NumberSchema<undefined>;
|
|
149
|
-
readonly mint: v.NumberSchema<undefined>;
|
|
150
|
-
readonly burn: v.NumberSchema<undefined>;
|
|
151
|
-
}, undefined>;
|
|
152
|
-
readonly ft: v.ObjectSchema<{
|
|
153
|
-
readonly transfer: v.NumberSchema<undefined>;
|
|
154
|
-
readonly mint: v.NumberSchema<undefined>;
|
|
155
|
-
readonly burn: v.NumberSchema<undefined>;
|
|
156
|
-
}, undefined>;
|
|
157
|
-
readonly nft: v.ObjectSchema<{
|
|
158
|
-
readonly transfer: v.NumberSchema<undefined>;
|
|
159
|
-
readonly mint: v.NumberSchema<undefined>;
|
|
160
|
-
readonly burn: v.NumberSchema<undefined>;
|
|
161
|
-
}, undefined>;
|
|
162
|
-
}, undefined>;
|
|
163
|
-
}, undefined>;
|
|
164
|
-
export type Result = v.InferOutput<typeof resultSchema>;
|
|
165
|
-
declare const resultsSchema: v.ArraySchema<v.ObjectSchema<{
|
|
166
|
-
readonly tx: v.VariantSchema<"tx_type", [v.ObjectSchema<{
|
|
167
|
-
readonly tx_id: v.StringSchema<undefined>;
|
|
168
|
-
readonly nonce: v.NumberSchema<undefined>;
|
|
169
|
-
readonly fee_rate: v.StringSchema<undefined>;
|
|
170
|
-
readonly sender_address: v.StringSchema<undefined>;
|
|
171
|
-
readonly sponsored: v.BooleanSchema<undefined>;
|
|
172
|
-
readonly post_condition_mode: v.StringSchema<undefined>;
|
|
173
|
-
readonly post_conditions: v.ArraySchema<v.UnknownSchema, undefined>;
|
|
174
|
-
readonly anchor_mode: v.StringSchema<undefined>;
|
|
175
|
-
readonly is_unanchored: v.BooleanSchema<undefined>;
|
|
176
|
-
readonly block_hash: v.StringSchema<undefined>;
|
|
177
|
-
readonly parent_block_hash: v.StringSchema<undefined>;
|
|
178
|
-
readonly block_height: v.NumberSchema<undefined>;
|
|
179
|
-
readonly block_time: v.NumberSchema<undefined>;
|
|
180
|
-
readonly block_time_iso: v.StringSchema<undefined>;
|
|
181
|
-
readonly burn_block_height: v.NumberSchema<undefined>;
|
|
182
|
-
readonly burn_block_time: v.NumberSchema<undefined>;
|
|
183
|
-
readonly burn_block_time_iso: v.StringSchema<undefined>;
|
|
184
|
-
readonly parent_burn_block_time: v.NumberSchema<undefined>;
|
|
185
|
-
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
186
|
-
readonly canonical: v.BooleanSchema<undefined>;
|
|
187
|
-
readonly tx_index: v.NumberSchema<undefined>;
|
|
188
|
-
readonly tx_status: v.StringSchema<undefined>;
|
|
189
|
-
readonly tx_result: v.ObjectSchema<{
|
|
190
|
-
readonly hex: v.StringSchema<undefined>;
|
|
191
|
-
readonly repr: v.StringSchema<undefined>;
|
|
192
|
-
}, undefined>;
|
|
193
|
-
readonly microblock_hash: v.StringSchema<undefined>;
|
|
194
|
-
readonly microblock_sequence: v.NumberSchema<undefined>;
|
|
195
|
-
readonly microblock_canonical: v.BooleanSchema<undefined>;
|
|
196
|
-
readonly event_count: v.NumberSchema<undefined>;
|
|
197
|
-
readonly events: v.ArraySchema<v.UnknownSchema, undefined>;
|
|
198
|
-
readonly execution_cost_read_count: v.NumberSchema<undefined>;
|
|
199
|
-
readonly execution_cost_read_length: v.NumberSchema<undefined>;
|
|
200
|
-
readonly execution_cost_runtime: v.NumberSchema<undefined>;
|
|
201
|
-
readonly execution_cost_write_count: v.NumberSchema<undefined>;
|
|
202
|
-
readonly execution_cost_write_length: v.NumberSchema<undefined>;
|
|
203
|
-
readonly tx_type: v.LiteralSchema<"contract_call", undefined>;
|
|
204
|
-
readonly contract_call: v.ObjectSchema<{
|
|
205
|
-
readonly contract_id: v.StringSchema<undefined>;
|
|
206
|
-
readonly function_name: v.StringSchema<undefined>;
|
|
207
|
-
readonly function_signature: v.StringSchema<undefined>;
|
|
208
|
-
readonly function_args: v.ArraySchema<v.ObjectSchema<{
|
|
209
|
-
readonly hex: v.StringSchema<undefined>;
|
|
210
|
-
readonly repr: v.StringSchema<undefined>;
|
|
211
|
-
readonly name: v.StringSchema<undefined>;
|
|
212
|
-
readonly type: v.StringSchema<undefined>;
|
|
213
|
-
}, undefined>, undefined>;
|
|
214
|
-
}, undefined>;
|
|
215
|
-
}, undefined>, v.ObjectSchema<{
|
|
216
|
-
readonly tx_id: v.StringSchema<undefined>;
|
|
217
|
-
readonly nonce: v.NumberSchema<undefined>;
|
|
218
|
-
readonly fee_rate: v.StringSchema<undefined>;
|
|
219
|
-
readonly sender_address: v.StringSchema<undefined>;
|
|
220
|
-
readonly sponsored: v.BooleanSchema<undefined>;
|
|
221
|
-
readonly post_condition_mode: v.StringSchema<undefined>;
|
|
222
|
-
readonly post_conditions: v.ArraySchema<v.UnknownSchema, undefined>;
|
|
223
|
-
readonly anchor_mode: v.StringSchema<undefined>;
|
|
224
|
-
readonly is_unanchored: v.BooleanSchema<undefined>;
|
|
225
|
-
readonly block_hash: v.StringSchema<undefined>;
|
|
226
|
-
readonly parent_block_hash: v.StringSchema<undefined>;
|
|
227
|
-
readonly block_height: v.NumberSchema<undefined>;
|
|
228
|
-
readonly block_time: v.NumberSchema<undefined>;
|
|
229
|
-
readonly block_time_iso: v.StringSchema<undefined>;
|
|
230
|
-
readonly burn_block_height: v.NumberSchema<undefined>;
|
|
231
|
-
readonly burn_block_time: v.NumberSchema<undefined>;
|
|
232
|
-
readonly burn_block_time_iso: v.StringSchema<undefined>;
|
|
233
|
-
readonly parent_burn_block_time: v.NumberSchema<undefined>;
|
|
234
|
-
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
235
|
-
readonly canonical: v.BooleanSchema<undefined>;
|
|
236
|
-
readonly tx_index: v.NumberSchema<undefined>;
|
|
237
|
-
readonly tx_status: v.StringSchema<undefined>;
|
|
238
|
-
readonly tx_result: v.ObjectSchema<{
|
|
239
|
-
readonly hex: v.StringSchema<undefined>;
|
|
240
|
-
readonly repr: v.StringSchema<undefined>;
|
|
241
|
-
}, undefined>;
|
|
242
|
-
readonly microblock_hash: v.StringSchema<undefined>;
|
|
243
|
-
readonly microblock_sequence: v.NumberSchema<undefined>;
|
|
244
|
-
readonly microblock_canonical: v.BooleanSchema<undefined>;
|
|
245
|
-
readonly event_count: v.NumberSchema<undefined>;
|
|
246
|
-
readonly events: v.ArraySchema<v.UnknownSchema, undefined>;
|
|
247
|
-
readonly execution_cost_read_count: v.NumberSchema<undefined>;
|
|
248
|
-
readonly execution_cost_read_length: v.NumberSchema<undefined>;
|
|
249
|
-
readonly execution_cost_runtime: v.NumberSchema<undefined>;
|
|
250
|
-
readonly execution_cost_write_count: v.NumberSchema<undefined>;
|
|
251
|
-
readonly execution_cost_write_length: v.NumberSchema<undefined>;
|
|
252
|
-
readonly tx_type: v.LiteralSchema<"smart_contract", undefined>;
|
|
253
|
-
readonly smart_contract: v.ObjectSchema<{
|
|
254
|
-
readonly clarity_version: v.UnionSchema<[v.NullSchema<undefined>, v.NumberSchema<undefined>], undefined>;
|
|
255
|
-
readonly contract_id: v.StringSchema<undefined>;
|
|
256
|
-
readonly source_code: v.StringSchema<undefined>;
|
|
257
|
-
}, undefined>;
|
|
258
|
-
}, undefined>, v.ObjectSchema<{
|
|
259
|
-
readonly tx_id: v.StringSchema<undefined>;
|
|
260
|
-
readonly nonce: v.NumberSchema<undefined>;
|
|
261
|
-
readonly fee_rate: v.StringSchema<undefined>;
|
|
262
|
-
readonly sender_address: v.StringSchema<undefined>;
|
|
263
|
-
readonly sponsored: v.BooleanSchema<undefined>;
|
|
264
|
-
readonly post_condition_mode: v.StringSchema<undefined>;
|
|
265
|
-
readonly post_conditions: v.ArraySchema<v.UnknownSchema, undefined>;
|
|
266
|
-
readonly anchor_mode: v.StringSchema<undefined>;
|
|
267
|
-
readonly is_unanchored: v.BooleanSchema<undefined>;
|
|
268
|
-
readonly block_hash: v.StringSchema<undefined>;
|
|
269
|
-
readonly parent_block_hash: v.StringSchema<undefined>;
|
|
270
|
-
readonly block_height: v.NumberSchema<undefined>;
|
|
271
|
-
readonly block_time: v.NumberSchema<undefined>;
|
|
272
|
-
readonly block_time_iso: v.StringSchema<undefined>;
|
|
273
|
-
readonly burn_block_height: v.NumberSchema<undefined>;
|
|
274
|
-
readonly burn_block_time: v.NumberSchema<undefined>;
|
|
275
|
-
readonly burn_block_time_iso: v.StringSchema<undefined>;
|
|
276
|
-
readonly parent_burn_block_time: v.NumberSchema<undefined>;
|
|
277
|
-
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
278
|
-
readonly canonical: v.BooleanSchema<undefined>;
|
|
279
|
-
readonly tx_index: v.NumberSchema<undefined>;
|
|
280
|
-
readonly tx_status: v.StringSchema<undefined>;
|
|
281
|
-
readonly tx_result: v.ObjectSchema<{
|
|
282
|
-
readonly hex: v.StringSchema<undefined>;
|
|
283
|
-
readonly repr: v.StringSchema<undefined>;
|
|
284
|
-
}, undefined>;
|
|
285
|
-
readonly microblock_hash: v.StringSchema<undefined>;
|
|
286
|
-
readonly microblock_sequence: v.NumberSchema<undefined>;
|
|
287
|
-
readonly microblock_canonical: v.BooleanSchema<undefined>;
|
|
288
|
-
readonly event_count: v.NumberSchema<undefined>;
|
|
289
|
-
readonly events: v.ArraySchema<v.UnknownSchema, undefined>;
|
|
290
|
-
readonly execution_cost_read_count: v.NumberSchema<undefined>;
|
|
291
|
-
readonly execution_cost_read_length: v.NumberSchema<undefined>;
|
|
292
|
-
readonly execution_cost_runtime: v.NumberSchema<undefined>;
|
|
293
|
-
readonly execution_cost_write_count: v.NumberSchema<undefined>;
|
|
294
|
-
readonly execution_cost_write_length: v.NumberSchema<undefined>;
|
|
295
|
-
readonly tx_type: v.LiteralSchema<"token_transfer", undefined>;
|
|
296
|
-
readonly token_transfer: v.ObjectSchema<{
|
|
297
|
-
readonly recipient_address: v.StringSchema<undefined>;
|
|
298
|
-
readonly amount: v.StringSchema<undefined>;
|
|
299
|
-
readonly memo: v.StringSchema<undefined>;
|
|
300
|
-
}, undefined>;
|
|
301
|
-
}, undefined>], undefined>;
|
|
302
|
-
readonly stx_sent: v.StringSchema<undefined>;
|
|
303
|
-
readonly stx_received: v.StringSchema<undefined>;
|
|
304
|
-
readonly events: v.ObjectSchema<{
|
|
305
|
-
readonly stx: v.ObjectSchema<{
|
|
306
|
-
readonly transfer: v.NumberSchema<undefined>;
|
|
307
|
-
readonly mint: v.NumberSchema<undefined>;
|
|
308
|
-
readonly burn: v.NumberSchema<undefined>;
|
|
309
|
-
}, undefined>;
|
|
310
|
-
readonly ft: v.ObjectSchema<{
|
|
311
|
-
readonly transfer: v.NumberSchema<undefined>;
|
|
312
|
-
readonly mint: v.NumberSchema<undefined>;
|
|
313
|
-
readonly burn: v.NumberSchema<undefined>;
|
|
314
|
-
}, undefined>;
|
|
315
|
-
readonly nft: v.ObjectSchema<{
|
|
316
|
-
readonly transfer: v.NumberSchema<undefined>;
|
|
317
|
-
readonly mint: v.NumberSchema<undefined>;
|
|
318
|
-
readonly burn: v.NumberSchema<undefined>;
|
|
319
|
-
}, undefined>;
|
|
320
|
-
}, undefined>;
|
|
321
|
-
}, undefined>, undefined>;
|
|
322
|
-
export type Results = v.InferOutput<typeof resultsSchema>;
|
|
323
|
-
declare const addressTransactionsResponseSchema: v.ObjectSchema<{
|
|
324
|
-
readonly results: v.ArraySchema<v.ObjectSchema<{
|
|
325
|
-
readonly tx: v.VariantSchema<"tx_type", [v.ObjectSchema<{
|
|
326
|
-
readonly tx_id: v.StringSchema<undefined>;
|
|
327
|
-
readonly nonce: v.NumberSchema<undefined>;
|
|
328
|
-
readonly fee_rate: v.StringSchema<undefined>;
|
|
329
|
-
readonly sender_address: v.StringSchema<undefined>;
|
|
330
|
-
readonly sponsored: v.BooleanSchema<undefined>;
|
|
331
|
-
readonly post_condition_mode: v.StringSchema<undefined>;
|
|
332
|
-
readonly post_conditions: v.ArraySchema<v.UnknownSchema, undefined>;
|
|
333
|
-
readonly anchor_mode: v.StringSchema<undefined>;
|
|
334
|
-
readonly is_unanchored: v.BooleanSchema<undefined>;
|
|
335
|
-
readonly block_hash: v.StringSchema<undefined>;
|
|
336
|
-
readonly parent_block_hash: v.StringSchema<undefined>;
|
|
337
|
-
readonly block_height: v.NumberSchema<undefined>;
|
|
338
|
-
readonly block_time: v.NumberSchema<undefined>;
|
|
339
|
-
readonly block_time_iso: v.StringSchema<undefined>;
|
|
340
|
-
readonly burn_block_height: v.NumberSchema<undefined>;
|
|
341
|
-
readonly burn_block_time: v.NumberSchema<undefined>;
|
|
342
|
-
readonly burn_block_time_iso: v.StringSchema<undefined>;
|
|
343
|
-
readonly parent_burn_block_time: v.NumberSchema<undefined>;
|
|
344
|
-
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
345
|
-
readonly canonical: v.BooleanSchema<undefined>;
|
|
346
|
-
readonly tx_index: v.NumberSchema<undefined>;
|
|
347
|
-
readonly tx_status: v.StringSchema<undefined>;
|
|
348
|
-
readonly tx_result: v.ObjectSchema<{
|
|
349
|
-
readonly hex: v.StringSchema<undefined>;
|
|
350
|
-
readonly repr: v.StringSchema<undefined>;
|
|
351
|
-
}, undefined>;
|
|
352
|
-
readonly microblock_hash: v.StringSchema<undefined>;
|
|
353
|
-
readonly microblock_sequence: v.NumberSchema<undefined>;
|
|
354
|
-
readonly microblock_canonical: v.BooleanSchema<undefined>;
|
|
355
|
-
readonly event_count: v.NumberSchema<undefined>;
|
|
356
|
-
readonly events: v.ArraySchema<v.UnknownSchema, undefined>;
|
|
357
|
-
readonly execution_cost_read_count: v.NumberSchema<undefined>;
|
|
358
|
-
readonly execution_cost_read_length: v.NumberSchema<undefined>;
|
|
359
|
-
readonly execution_cost_runtime: v.NumberSchema<undefined>;
|
|
360
|
-
readonly execution_cost_write_count: v.NumberSchema<undefined>;
|
|
361
|
-
readonly execution_cost_write_length: v.NumberSchema<undefined>;
|
|
362
|
-
readonly tx_type: v.LiteralSchema<"contract_call", undefined>;
|
|
363
|
-
readonly contract_call: v.ObjectSchema<{
|
|
364
|
-
readonly contract_id: v.StringSchema<undefined>;
|
|
365
|
-
readonly function_name: v.StringSchema<undefined>;
|
|
366
|
-
readonly function_signature: v.StringSchema<undefined>;
|
|
367
|
-
readonly function_args: v.ArraySchema<v.ObjectSchema<{
|
|
368
|
-
readonly hex: v.StringSchema<undefined>;
|
|
369
|
-
readonly repr: v.StringSchema<undefined>;
|
|
370
|
-
readonly name: v.StringSchema<undefined>;
|
|
371
|
-
readonly type: v.StringSchema<undefined>;
|
|
372
|
-
}, undefined>, undefined>;
|
|
373
|
-
}, undefined>;
|
|
374
|
-
}, undefined>, v.ObjectSchema<{
|
|
375
|
-
readonly tx_id: v.StringSchema<undefined>;
|
|
376
|
-
readonly nonce: v.NumberSchema<undefined>;
|
|
377
|
-
readonly fee_rate: v.StringSchema<undefined>;
|
|
378
|
-
readonly sender_address: v.StringSchema<undefined>;
|
|
379
|
-
readonly sponsored: v.BooleanSchema<undefined>;
|
|
380
|
-
readonly post_condition_mode: v.StringSchema<undefined>;
|
|
381
|
-
readonly post_conditions: v.ArraySchema<v.UnknownSchema, undefined>;
|
|
382
|
-
readonly anchor_mode: v.StringSchema<undefined>;
|
|
383
|
-
readonly is_unanchored: v.BooleanSchema<undefined>;
|
|
384
|
-
readonly block_hash: v.StringSchema<undefined>;
|
|
385
|
-
readonly parent_block_hash: v.StringSchema<undefined>;
|
|
386
|
-
readonly block_height: v.NumberSchema<undefined>;
|
|
387
|
-
readonly block_time: v.NumberSchema<undefined>;
|
|
388
|
-
readonly block_time_iso: v.StringSchema<undefined>;
|
|
389
|
-
readonly burn_block_height: v.NumberSchema<undefined>;
|
|
390
|
-
readonly burn_block_time: v.NumberSchema<undefined>;
|
|
391
|
-
readonly burn_block_time_iso: v.StringSchema<undefined>;
|
|
392
|
-
readonly parent_burn_block_time: v.NumberSchema<undefined>;
|
|
393
|
-
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
394
|
-
readonly canonical: v.BooleanSchema<undefined>;
|
|
395
|
-
readonly tx_index: v.NumberSchema<undefined>;
|
|
396
|
-
readonly tx_status: v.StringSchema<undefined>;
|
|
397
|
-
readonly tx_result: v.ObjectSchema<{
|
|
398
|
-
readonly hex: v.StringSchema<undefined>;
|
|
399
|
-
readonly repr: v.StringSchema<undefined>;
|
|
400
|
-
}, undefined>;
|
|
401
|
-
readonly microblock_hash: v.StringSchema<undefined>;
|
|
402
|
-
readonly microblock_sequence: v.NumberSchema<undefined>;
|
|
403
|
-
readonly microblock_canonical: v.BooleanSchema<undefined>;
|
|
404
|
-
readonly event_count: v.NumberSchema<undefined>;
|
|
405
|
-
readonly events: v.ArraySchema<v.UnknownSchema, undefined>;
|
|
406
|
-
readonly execution_cost_read_count: v.NumberSchema<undefined>;
|
|
407
|
-
readonly execution_cost_read_length: v.NumberSchema<undefined>;
|
|
408
|
-
readonly execution_cost_runtime: v.NumberSchema<undefined>;
|
|
409
|
-
readonly execution_cost_write_count: v.NumberSchema<undefined>;
|
|
410
|
-
readonly execution_cost_write_length: v.NumberSchema<undefined>;
|
|
411
|
-
readonly tx_type: v.LiteralSchema<"smart_contract", undefined>;
|
|
412
|
-
readonly smart_contract: v.ObjectSchema<{
|
|
413
|
-
readonly clarity_version: v.UnionSchema<[v.NullSchema<undefined>, v.NumberSchema<undefined>], undefined>;
|
|
414
|
-
readonly contract_id: v.StringSchema<undefined>;
|
|
415
|
-
readonly source_code: v.StringSchema<undefined>;
|
|
416
|
-
}, undefined>;
|
|
417
|
-
}, undefined>, v.ObjectSchema<{
|
|
418
|
-
readonly tx_id: v.StringSchema<undefined>;
|
|
419
|
-
readonly nonce: v.NumberSchema<undefined>;
|
|
420
|
-
readonly fee_rate: v.StringSchema<undefined>;
|
|
421
|
-
readonly sender_address: v.StringSchema<undefined>;
|
|
422
|
-
readonly sponsored: v.BooleanSchema<undefined>;
|
|
423
|
-
readonly post_condition_mode: v.StringSchema<undefined>;
|
|
424
|
-
readonly post_conditions: v.ArraySchema<v.UnknownSchema, undefined>;
|
|
425
|
-
readonly anchor_mode: v.StringSchema<undefined>;
|
|
426
|
-
readonly is_unanchored: v.BooleanSchema<undefined>;
|
|
427
|
-
readonly block_hash: v.StringSchema<undefined>;
|
|
428
|
-
readonly parent_block_hash: v.StringSchema<undefined>;
|
|
429
|
-
readonly block_height: v.NumberSchema<undefined>;
|
|
430
|
-
readonly block_time: v.NumberSchema<undefined>;
|
|
431
|
-
readonly block_time_iso: v.StringSchema<undefined>;
|
|
432
|
-
readonly burn_block_height: v.NumberSchema<undefined>;
|
|
433
|
-
readonly burn_block_time: v.NumberSchema<undefined>;
|
|
434
|
-
readonly burn_block_time_iso: v.StringSchema<undefined>;
|
|
435
|
-
readonly parent_burn_block_time: v.NumberSchema<undefined>;
|
|
436
|
-
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
437
|
-
readonly canonical: v.BooleanSchema<undefined>;
|
|
438
|
-
readonly tx_index: v.NumberSchema<undefined>;
|
|
439
|
-
readonly tx_status: v.StringSchema<undefined>;
|
|
440
|
-
readonly tx_result: v.ObjectSchema<{
|
|
441
|
-
readonly hex: v.StringSchema<undefined>;
|
|
442
|
-
readonly repr: v.StringSchema<undefined>;
|
|
443
|
-
}, undefined>;
|
|
444
|
-
readonly microblock_hash: v.StringSchema<undefined>;
|
|
445
|
-
readonly microblock_sequence: v.NumberSchema<undefined>;
|
|
446
|
-
readonly microblock_canonical: v.BooleanSchema<undefined>;
|
|
447
|
-
readonly event_count: v.NumberSchema<undefined>;
|
|
448
|
-
readonly events: v.ArraySchema<v.UnknownSchema, undefined>;
|
|
449
|
-
readonly execution_cost_read_count: v.NumberSchema<undefined>;
|
|
450
|
-
readonly execution_cost_read_length: v.NumberSchema<undefined>;
|
|
451
|
-
readonly execution_cost_runtime: v.NumberSchema<undefined>;
|
|
452
|
-
readonly execution_cost_write_count: v.NumberSchema<undefined>;
|
|
453
|
-
readonly execution_cost_write_length: v.NumberSchema<undefined>;
|
|
454
|
-
readonly tx_type: v.LiteralSchema<"token_transfer", undefined>;
|
|
455
|
-
readonly token_transfer: v.ObjectSchema<{
|
|
456
|
-
readonly recipient_address: v.StringSchema<undefined>;
|
|
457
|
-
readonly amount: v.StringSchema<undefined>;
|
|
458
|
-
readonly memo: v.StringSchema<undefined>;
|
|
459
|
-
}, undefined>;
|
|
460
|
-
}, undefined>], undefined>;
|
|
461
|
-
readonly stx_sent: v.StringSchema<undefined>;
|
|
462
|
-
readonly stx_received: v.StringSchema<undefined>;
|
|
463
|
-
readonly events: v.ObjectSchema<{
|
|
464
|
-
readonly stx: v.ObjectSchema<{
|
|
465
|
-
readonly transfer: v.NumberSchema<undefined>;
|
|
466
|
-
readonly mint: v.NumberSchema<undefined>;
|
|
467
|
-
readonly burn: v.NumberSchema<undefined>;
|
|
468
|
-
}, undefined>;
|
|
469
|
-
readonly ft: v.ObjectSchema<{
|
|
470
|
-
readonly transfer: v.NumberSchema<undefined>;
|
|
471
|
-
readonly mint: v.NumberSchema<undefined>;
|
|
472
|
-
readonly burn: v.NumberSchema<undefined>;
|
|
473
|
-
}, undefined>;
|
|
474
|
-
readonly nft: v.ObjectSchema<{
|
|
475
|
-
readonly transfer: v.NumberSchema<undefined>;
|
|
476
|
-
readonly mint: v.NumberSchema<undefined>;
|
|
477
|
-
readonly burn: v.NumberSchema<undefined>;
|
|
478
|
-
}, undefined>;
|
|
479
|
-
}, undefined>;
|
|
480
|
-
}, undefined>, undefined>;
|
|
481
|
-
readonly limit: v.NumberSchema<undefined>;
|
|
482
|
-
readonly offset: v.NumberSchema<undefined>;
|
|
483
|
-
readonly total: v.NumberSchema<undefined>;
|
|
484
|
-
}, undefined>;
|
|
485
|
-
export type AddressTransactionsResponse = v.InferOutput<typeof addressTransactionsResponseSchema>;
|
|
486
|
-
export declare function addressTransactions(args: Args): Promise<SafeResult<AddressTransactionsResponse, SafeError<"FetchAddressTransactionsError" | "ParseBodyError" | "ValidateDataError">>>;
|
|
487
|
-
export {};
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { error, safePromise, success, } from "../../utils/safe.js";
|
|
2
|
-
import { baseListResponseSchema, } from "../types.js";
|
|
3
|
-
import { transactionSchema } from "./schemas.js";
|
|
4
|
-
import * as v from "valibot";
|
|
5
|
-
// May be a good idea to move this to a shared location
|
|
6
|
-
const resultSchema = v.object({
|
|
7
|
-
tx: transactionSchema,
|
|
8
|
-
stx_sent: v.string(),
|
|
9
|
-
stx_received: v.string(),
|
|
10
|
-
events: v.object({
|
|
11
|
-
stx: v.object({
|
|
12
|
-
transfer: v.number(),
|
|
13
|
-
mint: v.number(),
|
|
14
|
-
burn: v.number(),
|
|
15
|
-
}),
|
|
16
|
-
ft: v.object({
|
|
17
|
-
transfer: v.number(),
|
|
18
|
-
mint: v.number(),
|
|
19
|
-
burn: v.number(),
|
|
20
|
-
}),
|
|
21
|
-
nft: v.object({
|
|
22
|
-
transfer: v.number(),
|
|
23
|
-
mint: v.number(),
|
|
24
|
-
burn: v.number(),
|
|
25
|
-
}),
|
|
26
|
-
}),
|
|
27
|
-
});
|
|
28
|
-
const resultsSchema = v.array(resultSchema);
|
|
29
|
-
const addressTransactionsResponseSchema = v.object({
|
|
30
|
-
...baseListResponseSchema.entries,
|
|
31
|
-
results: resultsSchema,
|
|
32
|
-
});
|
|
33
|
-
export async function addressTransactions(args) {
|
|
34
|
-
const search = new URLSearchParams();
|
|
35
|
-
if (args.limit)
|
|
36
|
-
search.append("limit", args.limit.toString());
|
|
37
|
-
if (args.offset)
|
|
38
|
-
search.append("offset", args.offset.toString());
|
|
39
|
-
const init = {};
|
|
40
|
-
if (args.apiKeyConfig) {
|
|
41
|
-
init.headers = {
|
|
42
|
-
[args.apiKeyConfig.header]: args.apiKeyConfig.key,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
const res = await fetch(`${args.baseUrl}/extended/v2/addresses/${args.address}/transactions?${search}`, init);
|
|
46
|
-
if (!res.ok) {
|
|
47
|
-
return error({
|
|
48
|
-
name: "FetchAddressTransactionsError",
|
|
49
|
-
message: "Failed to fetch address transactions.",
|
|
50
|
-
data: {
|
|
51
|
-
status: res.status,
|
|
52
|
-
statusText: res.statusText,
|
|
53
|
-
bodyParseResult: await safePromise(res.json()),
|
|
54
|
-
},
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
const [jsonParseError, data] = await safePromise(res.json());
|
|
58
|
-
if (jsonParseError) {
|
|
59
|
-
return error({
|
|
60
|
-
name: "ParseBodyError",
|
|
61
|
-
message: "Failed to parse response body as JSON.",
|
|
62
|
-
data: jsonParseError,
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
const validationResult = v.safeParse(addressTransactionsResponseSchema, data);
|
|
66
|
-
if (!validationResult.success) {
|
|
67
|
-
return error({
|
|
68
|
-
name: "ValidateDataError",
|
|
69
|
-
message: "Failed to validate data.",
|
|
70
|
-
data: validationResult,
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
return success(validationResult.output);
|
|
74
|
-
}
|
|
75
|
-
//# sourceMappingURL=address-transactions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"address-transactions.js","sourceRoot":"","sources":["../../../src/stacks-api/transactions/address-transactions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,WAAW,EACX,OAAO,GAGR,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,sBAAsB,GAGvB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAO7B,uDAAuD;AACvD,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5B,EAAE,EAAE,iBAAiB;IACrB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC;YACZ,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;YACpB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;YAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;SACjB,CAAC;QACF,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC;YACX,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;YACpB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;YAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;SACjB,CAAC;QACF,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC;YACZ,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;YACpB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;YAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;SACjB,CAAC;KACH,CAAC;CACH,CAAC,CAAC;AAGH,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;AAG5C,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,GAAG,sBAAsB,CAAC,OAAO;IACjC,OAAO,EAAE,aAAa;CACvB,CAAC,CAAC;AAKH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,IAAU;IASV,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;IACrC,IAAI,IAAI,CAAC,KAAK;QAAE,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC9D,IAAI,IAAI,CAAC,MAAM;QAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;IAEjE,MAAM,IAAI,GAAgB,EAAE,CAAC;IAC7B,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG;YACb,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,GAAG;SAClD,CAAC;IACJ,CAAC;IAED,MAAM,GAAG,GAAG,MAAM,KAAK,CACrB,GAAG,IAAI,CAAC,OAAO,0BAA0B,IAAI,CAAC,OAAO,iBAAiB,MAAM,EAAE,EAC9E,IAAI,CACL,CAAC;IAEF,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;QACZ,OAAO,KAAK,CAAC;YACX,IAAI,EAAE,+BAA+B;YACrC,OAAO,EAAE,uCAAuC;YAChD,IAAI,EAAE;gBACJ,MAAM,EAAE,GAAG,CAAC,MAAM;gBAClB,UAAU,EAAE,GAAG,CAAC,UAAU;gBAC1B,eAAe,EAAE,MAAM,WAAW,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;aAC/C;SACF,CAAC,CAAC;IACL,CAAC;IAED,MAAM,CAAC,cAAc,EAAE,IAAI,CAAC,GAAG,MAAM,WAAW,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IAC7D,IAAI,cAAc,EAAE,CAAC;QACnB,OAAO,KAAK,CAAC;YACX,IAAI,EAAE,gBAAgB;YACtB,OAAO,EAAE,wCAAwC;YACjD,IAAI,EAAE,cAAc;SACrB,CAAC,CAAC;IACL,CAAC;IAED,MAAM,gBAAgB,GAAG,CAAC,CAAC,SAAS,CAAC,iCAAiC,EAAE,IAAI,CAAC,CAAC;IAC9E,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;YACX,IAAI,EAAE,mBAAmB;YACzB,OAAO,EAAE,0BAA0B;YACnC,IAAI,EAAE,gBAAgB;SACvB,CAAC,CAAC;IACL,CAAC;IAED,OAAO,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type Result } from "../../utils/safe.js";
|
|
2
|
-
import type { ApiRequestOptions } from "../types.js";
|
|
3
|
-
import { type Transaction } from "./schemas.js";
|
|
4
|
-
type Args = {
|
|
5
|
-
transactionId: string;
|
|
6
|
-
} & ApiRequestOptions;
|
|
7
|
-
export declare function getTransaction(args: Args): Promise<Result<Transaction>>;
|
|
8
|
-
export {};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { success, error, safePromise } from "../../utils/safe.js";
|
|
2
|
-
import { transactionSchema } from "./schemas.js";
|
|
3
|
-
import * as v from "valibot";
|
|
4
|
-
export async function getTransaction(args) {
|
|
5
|
-
const init = {};
|
|
6
|
-
if (args.apiKeyConfig) {
|
|
7
|
-
init.headers = {
|
|
8
|
-
[args.apiKeyConfig.header]: args.apiKeyConfig.key,
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
const endpoint = `${args.baseUrl}/extended/v1/tx/${args.transactionId}`;
|
|
12
|
-
const res = await fetch(endpoint, init);
|
|
13
|
-
if (!res.ok) {
|
|
14
|
-
return error({
|
|
15
|
-
name: "FetchTransactionError",
|
|
16
|
-
message: `Failed to fetch transaction ${args.transactionId}`,
|
|
17
|
-
response: {
|
|
18
|
-
status: res.status,
|
|
19
|
-
statusText: res.statusText,
|
|
20
|
-
body: await safePromise(res.json()),
|
|
21
|
-
},
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
const [jsonParseError, data] = await safePromise(res.json());
|
|
25
|
-
if (jsonParseError) {
|
|
26
|
-
return error({
|
|
27
|
-
name: "ParseBodyError",
|
|
28
|
-
message: "Failed to parse response body as JSON.",
|
|
29
|
-
error: jsonParseError,
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
const validationResult = v.safeParse(transactionSchema, data);
|
|
33
|
-
if (!validationResult.success) {
|
|
34
|
-
return error({
|
|
35
|
-
name: "ValidateDataError",
|
|
36
|
-
message: "Failed to validate data.",
|
|
37
|
-
error: validationResult,
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
return success(validationResult.output);
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=get-transaction.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-transaction.js","sourceRoot":"","sources":["../../../src/stacks-api/transactions/get-transaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAe,MAAM,qBAAqB,CAAC;AAE/E,OAAO,EAAE,iBAAiB,EAAoB,MAAM,cAAc,CAAC;AACnE,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAM7B,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,IAAU;IAC7C,MAAM,IAAI,GAAgB,EAAE,CAAC;IAC7B,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG;YACb,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,GAAG;SAClD,CAAC;IACJ,CAAC;IAED,MAAM,QAAQ,GAAG,GAAG,IAAI,CAAC,OAAO,mBAAmB,IAAI,CAAC,aAAa,EAAE,CAAC;IACxE,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAExC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;QACZ,OAAO,KAAK,CAAC;YACX,IAAI,EAAE,uBAAuB;YAC7B,OAAO,EAAE,+BAA+B,IAAI,CAAC,aAAa,EAAE;YAC5D,QAAQ,EAAE;gBACR,MAAM,EAAE,GAAG,CAAC,MAAM;gBAClB,UAAU,EAAE,GAAG,CAAC,UAAU;gBAC1B,IAAI,EAAE,MAAM,WAAW,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;aACpC;SACF,CAAC,CAAC;IACL,CAAC;IAED,MAAM,CAAC,cAAc,EAAE,IAAI,CAAC,GAAG,MAAM,WAAW,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IAC7D,IAAI,cAAc,EAAE,CAAC;QACnB,OAAO,KAAK,CAAC;YACX,IAAI,EAAE,gBAAgB;YACtB,OAAO,EAAE,wCAAwC;YACjD,KAAK,EAAE,cAAc;SACtB,CAAC,CAAC;IACL,CAAC;IAED,MAAM,gBAAgB,GAAG,CAAC,CAAC,SAAS,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC;IAC9D,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;YACX,IAAI,EAAE,mBAAmB;YACzB,OAAO,EAAE,0BAA0B;YACnC,KAAK,EAAE,gBAAgB;SACxB,CAAC,CAAC;IACL,CAAC;IAED,OAAO,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/stacks-api/transactions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,mBAAmB;IACnB,cAAc;CACf,CAAC"}
|