@@ -23,7 +23,7 @@ import { has0xPrefix } from '@hirosystems/api-toolkit';
23
23
import { FastifyPluginAsync } from 'fastify' ;
24
24
import { Type , TypeBoxTypeProvider } from '@fastify/type-provider-typebox' ;
25
25
import { Server } from 'node:http' ;
26
- import { LimitParam , OffsetParam , UnanchoredParamSchema } from '../schemas/params' ;
26
+ import { LimitParam , OffsetParam , PrincipalSchema , UnanchoredParamSchema } from '../schemas/params' ;
27
27
import {
28
28
AddressBalance ,
29
29
AddressBalanceSchema ,
@@ -87,10 +87,7 @@ export const AddressRoutes: FastifyPluginAsync<
87
87
description : `Retrieves STX token balance for a given Address or Contract Identifier.` ,
88
88
tags : [ 'Accounts' ] ,
89
89
params : Type . Object ( {
90
- principal : Type . String ( {
91
- description : 'Stacks address or a Contract identifier' ,
92
- examples : [ 'SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0' ] ,
93
- } ) ,
90
+ principal : PrincipalSchema ,
94
91
} ) ,
95
92
querystring : Type . Object ( {
96
93
unanchored : UnanchoredParamSchema ,
@@ -155,10 +152,7 @@ export const AddressRoutes: FastifyPluginAsync<
155
152
description : `Retrieves total account balance information for a given Address or Contract Identifier. This includes the balances of STX Tokens, Fungible Tokens and Non-Fungible Tokens for the account.` ,
156
153
tags : [ 'Accounts' ] ,
157
154
params : Type . Object ( {
158
- principal : Type . String ( {
159
- description : 'Stacks address or a Contract identifier' ,
160
- examples : [ 'SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0' ] ,
161
- } ) ,
155
+ principal : PrincipalSchema ,
162
156
} ) ,
163
157
querystring : Type . Object ( {
164
158
unanchored : UnanchoredParamSchema ,
@@ -264,10 +258,7 @@ export const AddressRoutes: FastifyPluginAsync<
264
258
If you need to actively monitor new transactions for an address or contract id, we highly recommend subscribing to [WebSockets or Socket.io](https://github.com/hirosystems/stacks-blockchain-api/tree/master/client) for real-time updates.` ,
265
259
tags : [ 'Accounts' ] ,
266
260
params : Type . Object ( {
267
- principal : Type . String ( {
268
- description : 'Stacks address or a Contract identifier' ,
269
- examples : [ 'SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0' ] ,
270
- } ) ,
261
+ principal : PrincipalSchema ,
271
262
} ) ,
272
263
querystring : Type . Object ( {
273
264
limit : LimitParam ( ResourceType . Tx ) ,
@@ -347,10 +338,7 @@ export const AddressRoutes: FastifyPluginAsync<
347
338
Retrieves transaction details for a given Transaction Id \`tx_id\`, for a given account or contract Identifier.` ,
348
339
tags : [ 'Accounts' ] ,
349
340
params : Type . Object ( {
350
- principal : Type . String ( {
351
- description : 'Stacks address or a Contract identifier' ,
352
- examples : [ 'SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0' ] ,
353
- } ) ,
341
+ principal : PrincipalSchema ,
354
342
tx_id : Type . String ( {
355
343
description : 'Transaction ID' ,
356
344
examples : [ '0x34d79c7cfc2fe525438736733e501a4bf0308a5556e3e080d1e2c0858aad7448' ] ,
@@ -414,10 +402,7 @@ export const AddressRoutes: FastifyPluginAsync<
414
402
description : `Retrieve all transactions for an account or contract identifier including STX transfers for each transaction.` ,
415
403
tags : [ 'Accounts' ] ,
416
404
params : Type . Object ( {
417
- principal : Type . String ( {
418
- description : 'Stacks address or a Contract identifier' ,
419
- examples : [ 'SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0' ] ,
420
- } ) ,
405
+ principal : PrincipalSchema ,
421
406
} ) ,
422
407
querystring : Type . Object ( {
423
408
limit : LimitParam ( ResourceType . Tx ) ,
@@ -537,10 +522,7 @@ export const AddressRoutes: FastifyPluginAsync<
537
522
description : `Retrieves a list of all assets events associated with an account or a Contract Identifier. This includes Transfers, Mints.` ,
538
523
tags : [ 'Accounts' ] ,
539
524
params : Type . Object ( {
540
- principal : Type . String ( {
541
- description : 'Stacks address or a Contract identifier' ,
542
- examples : [ 'SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0' ] ,
543
- } ) ,
525
+ principal : PrincipalSchema ,
544
526
} ) ,
545
527
querystring : Type . Object ( {
546
528
limit : LimitParam ( ResourceType . Event ) ,
@@ -598,10 +580,7 @@ export const AddressRoutes: FastifyPluginAsync<
598
580
and transfers from contract-call transactions a the \`send-many-memo\` bulk sending contract.` ,
599
581
tags : [ 'Accounts' ] ,
600
582
params : Type . Object ( {
601
- principal : Type . String ( {
602
- description : 'Stacks address or a Contract identifier' ,
603
- examples : [ 'SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0' ] ,
604
- } ) ,
583
+ principal : PrincipalSchema ,
605
584
} ) ,
606
585
querystring : Type . Object ( {
607
586
limit : LimitParam ( ResourceType . Tx ) ,
@@ -700,10 +679,7 @@ export const AddressRoutes: FastifyPluginAsync<
700
679
description : `Retrieves all transactions for a given address that are currently in mempool` ,
701
680
tags : [ 'Transactions' ] ,
702
681
params : Type . Object ( {
703
- principal : Type . String ( {
704
- description : 'Stacks address or a Contract identifier' ,
705
- examples : [ 'SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0' ] ,
706
- } ) ,
682
+ principal : PrincipalSchema ,
707
683
} ) ,
708
684
querystring : Type . Object ( {
709
685
limit : LimitParam ( ResourceType . Tx ) ,
@@ -750,10 +726,7 @@ export const AddressRoutes: FastifyPluginAsync<
750
726
description : `Retrieves the latest nonce values used by an account by inspecting the mempool, microblock transactions, and anchored transactions.` ,
751
727
tags : [ 'Accounts' ] ,
752
728
params : Type . Object ( {
753
- principal : Type . String ( {
754
- description : 'Stacks address or a Contract identifier' ,
755
- examples : [ 'SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0' ] ,
756
- } ) ,
729
+ principal : PrincipalSchema ,
757
730
} ) ,
758
731
querystring : Type . Object ( {
759
732
block_height : Type . Optional (
0 commit comments