Interaction¶
cyhole.solscan.v2.Solscan
¶
Solscan(api_key: str | None = None)
Bases: Interaction
Class used to connect only Solscan V2 API, one of them most popular Solana chain explorer. To have access Solscan Pro API is required to have a valid API key.
Check API Documentation for all the details on the available endpoints.
Solscan API is currently divided into two versions:
- v1 - the first and classic version of the Pro API.
- v2 - a new and improved version of the Pro API, with more endpoints and features. This version is under development and may have some changes.
Info
This Interaction is dedicated to the Solscan Pro API v2.0.
Use cyhole.solscan.SolscanV1 or cyhole.solscan.v1.Solscan for the Solscan Pro API v1.0.
If the API key is not provided during the object creation, then it is automatically
retrieved from environment variable SOLSCAN_API_V2_KEY.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
api_key
|
str | None
|
specifies the API key for Solscan Pro API v2. |
None
|
Example
Source code in src/cyhole/solscan/v2/interaction.py
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 | |
_get_account_transfers
¶
_get_account_transfers(
sync: Literal[True],
account: str,
params: GetAccountTransferParam = GetAccountTransferParam(),
) -> GetAccountTransferResponse
_get_account_transfers(
sync: Literal[False],
account: str,
params: GetAccountTransferParam = GetAccountTransferParam(),
) -> Coroutine[None, None, GetAccountTransferResponse]
_get_account_transfers(
sync: bool,
account: str,
params: GetAccountTransferParam = GetAccountTransferParam(),
) -> (
GetAccountTransferResponse
| Coroutine[None, None, GetAccountTransferResponse]
)
This function refers to the GET Account Transfer of V2 API endpoint, and it is used to get transfers of an account.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
account
|
str
|
The account address. |
required |
params
|
GetAccountTransferParam
|
The parameters to be used in the request. More details in the object definition. |
GetAccountTransferParam()
|
Returns:
| Type | Description |
|---|---|
GetAccountTransferResponse | Coroutine[None, None, GetAccountTransferResponse]
|
List of transfers of the account. |
Source code in src/cyhole/solscan/v2/interaction.py
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | |
_get_account_token_nft_account
¶
_get_account_token_nft_account(
sync: Literal[True],
account: str,
account_type: str,
page: int = 1,
page_size: int = SolscanPageSizeType.SIZE_10.value,
hide_zero: bool = True,
) -> GetAccountTokenNFTAccountResponse
_get_account_token_nft_account(
sync: Literal[False],
account: str,
account_type: str,
page: int = 1,
page_size: int = SolscanPageSizeType.SIZE_10.value,
hide_zero: bool = True,
) -> Coroutine[
None, None, GetAccountTokenNFTAccountResponse
]
_get_account_token_nft_account(
sync: bool,
account: str,
account_type: str,
page: int = 1,
page_size: int = SolscanPageSizeType.SIZE_10.value,
hide_zero: bool = True,
) -> (
GetAccountTokenNFTAccountResponse
| Coroutine[
None, None, GetAccountTokenNFTAccountResponse
]
)
This function refers to the GET Account Token/NFT Account of V2 API endpoint, and it is used to get the NFT/Tokens' accounts of an account.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
account
|
str
|
The account address. |
required |
account_type
|
str
|
The account type (NFT/Token).
The supported types are available on |
required |
page
|
int
|
The page number. |
1
|
page_size
|
int
|
The number of accounts per page.
The supported types are available on |
SolscanPageSizeType.SIZE_10.value
|
hide_zero
|
bool
|
Hide zero balances accounts. |
True
|
Returns:
| Type | Description |
|---|---|
GetAccountTokenNFTAccountResponse | Coroutine[None, None, GetAccountTokenNFTAccountResponse]
|
List of NFT/Tokens accountS. |
Source code in src/cyhole/solscan/v2/interaction.py
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 | |
_get_account_defi_activities
¶
_get_account_defi_activities(
sync: Literal[True],
account: str,
params: GetAccountDefiActivitiesParam = GetAccountDefiActivitiesParam(),
) -> GetAccountDefiActivitiesResponse
_get_account_defi_activities(
sync: Literal[False],
account: str,
params: GetAccountDefiActivitiesParam = GetAccountDefiActivitiesParam(),
) -> Coroutine[
None, None, GetAccountDefiActivitiesResponse
]
_get_account_defi_activities(
sync: bool,
account: str,
params: GetAccountDefiActivitiesParam = GetAccountDefiActivitiesParam(),
) -> (
GetAccountDefiActivitiesResponse
| Coroutine[
None, None, GetAccountDefiActivitiesResponse
]
)
This function refers to the GET Account DeFi Activities of V2 API endpoint, and it is used to get the DeFi activities of an account.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
account
|
str
|
The account address. |
required |
params
|
GetAccountDefiActivitiesParam
|
The parameters to be used in the request. |
GetAccountDefiActivitiesParam()
|
Returns:
| Type | Description |
|---|---|
GetAccountDefiActivitiesResponse | Coroutine[None, None, GetAccountDefiActivitiesResponse]
|
List of DeFi activities. |
Source code in src/cyhole/solscan/v2/interaction.py
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 | |
_get_account_balance_change_activities
¶
_get_account_balance_change_activities(
sync: Literal[True],
account: str,
params: GetAccountBalanceChangeActivitiesParam = GetAccountBalanceChangeActivitiesParam(),
) -> GetAccountBalanceChangeActivitiesResponse
_get_account_balance_change_activities(
sync: Literal[False],
account: str,
params: GetAccountBalanceChangeActivitiesParam = GetAccountBalanceChangeActivitiesParam(),
) -> Coroutine[
None, None, GetAccountBalanceChangeActivitiesResponse
]
_get_account_balance_change_activities(
sync: bool,
account: str,
params: GetAccountBalanceChangeActivitiesParam = GetAccountBalanceChangeActivitiesParam(),
) -> (
GetAccountBalanceChangeActivitiesResponse
| Coroutine[
None,
None,
GetAccountBalanceChangeActivitiesResponse,
]
)
This function refers to the GET Account Balance Change Activities of V2 API endpoint, and it is used to get the balance change activities of an account.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
account
|
str
|
The account address. |
required |
params
|
GetAccountBalanceChangeActivitiesParam
|
The parameters to be used in the request. |
GetAccountBalanceChangeActivitiesParam()
|
Returns:
| Type | Description |
|---|---|
GetAccountBalanceChangeActivitiesResponse | Coroutine[None, None, GetAccountBalanceChangeActivitiesResponse]
|
List of balance change activities. |
Source code in src/cyhole/solscan/v2/interaction.py
258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 | |
_get_account_transactions
¶
_get_account_transactions(
sync: Literal[True],
account: str,
before_transaction: str | None = None,
limit: int = SolscanReturnLimitType.LIMIT_10.value,
) -> GetAccountTransactionsResponse
_get_account_transactions(
sync: Literal[False],
account: str,
before_transaction: str | None = None,
limit: int = SolscanReturnLimitType.LIMIT_10.value,
) -> Coroutine[None, None, GetAccountTransactionsResponse]
_get_account_transactions(
sync: bool,
account: str,
before_transaction: str | None = None,
limit: int = SolscanReturnLimitType.LIMIT_10.value,
) -> (
GetAccountTransactionsResponse
| Coroutine[None, None, GetAccountTransactionsResponse]
)
This function refers to the GET Account Transactions of V2 API endpoint, and it is used to get the latest transactions of an account.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
account
|
str
|
The account address. |
required |
before_transaction
|
str | None
|
The signature of the latest transaction of previous page. |
None
|
limit
|
int
|
The number of transactions to be returned.
The supported types are available on |
SolscanReturnLimitType.LIMIT_10.value
|
Returns:
| Type | Description |
|---|---|
GetAccountTransactionsResponse | Coroutine[None, None, GetAccountTransactionsResponse]
|
List of transactions of the account. |
Source code in src/cyhole/solscan/v2/interaction.py
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 | |
_get_account_stake
¶
_get_account_stake(
sync: Literal[True],
account: str,
page: int = 1,
limit: int = SolscanReturnLimitType.LIMIT_10.value,
) -> GetAccountStakeResponse
_get_account_stake(
sync: Literal[False],
account: str,
page: int = 1,
limit: int = SolscanReturnLimitType.LIMIT_10.value,
) -> Coroutine[None, None, GetAccountStakeResponse]
_get_account_stake(
sync: bool,
account: str,
page: int = 1,
limit: int = SolscanReturnLimitType.LIMIT_10.value,
) -> (
GetAccountStakeResponse
| Coroutine[None, None, GetAccountStakeResponse]
)
This function refers to the GET Account Stake of V2 API endpoint, and it is used to get the staking activities of an account.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
account
|
str
|
The account address. |
required |
page
|
int
|
The page number. |
1
|
limit
|
int
|
The number of staking activities to be returned.
The supported types are available on |
SolscanReturnLimitType.LIMIT_10.value
|
Returns:
| Type | Description |
|---|---|
GetAccountStakeResponse | Coroutine[None, None, GetAccountStakeResponse]
|
List of staking activities of the account. |
Source code in src/cyhole/solscan/v2/interaction.py
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 | |
_get_account_detail
¶
_get_account_detail(
sync: Literal[True], account: str
) -> GetAccountDetailResponse
_get_account_detail(
sync: Literal[False], account: str
) -> Coroutine[None, None, GetAccountDetailResponse]
_get_account_detail(
sync: bool, account: str
) -> (
GetAccountDetailResponse
| Coroutine[None, None, GetAccountDetailResponse]
)
This function refers to the GET Account Detail of V2 API endpoint, and it is used to get the detail of an account.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
account
|
str
|
The account address. |
required |
Returns:
| Type | Description |
|---|---|
GetAccountDetailResponse | Coroutine[None, None, GetAccountDetailResponse]
|
Detail of the account. |
Source code in src/cyhole/solscan/v2/interaction.py
373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 | |
_get_account_rewards_export
¶
_get_account_rewards_export(
sync: Literal[True],
account: str,
dt_from: datetime,
dt_to: datetime,
) -> GetAccountRewardsExportResponse
_get_account_rewards_export(
sync: Literal[False],
account: str,
dt_from: datetime,
dt_to: datetime,
) -> Coroutine[None, None, GetAccountRewardsExportResponse]
_get_account_rewards_export(
sync: bool,
account: str,
dt_from: datetime,
dt_to: datetime,
) -> (
GetAccountRewardsExportResponse
| Coroutine[None, None, GetAccountRewardsExportResponse]
)
This function refers to the GET Account Rewards Export of V2 API endpoint, and it is used to get export rewards of an account in CSV format.
Info
The limit of the export rewards is 5000 for request. Moreover, it is possible to execute the request only 1 time for every minute.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
account
|
str
|
The account address. |
required |
dt_from
|
datetime
|
The start time. |
required |
dt_to
|
datetime
|
The end time. |
required |
Returns:
| Type | Description |
|---|---|
GetAccountRewardsExportResponse | Coroutine[None, None, GetAccountRewardsExportResponse]
|
List of export rewards of the account. |
Source code in src/cyhole/solscan/v2/interaction.py
405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 | |
_get_token_transfer
¶
_get_token_transfer(
sync: Literal[True],
token: str,
params: GetTokenTransferParam = GetTokenTransferParam(),
) -> GetTokenTransferResponse
_get_token_transfer(
sync: Literal[False],
token: str,
params: GetTokenTransferParam = GetTokenTransferParam(),
) -> Coroutine[None, None, GetTokenTransferResponse]
_get_token_transfer(
sync: bool,
token: str,
params: GetTokenTransferParam = GetTokenTransferParam(),
) -> (
GetTokenTransferResponse
| Coroutine[None, None, GetTokenTransferResponse]
)
This function refers to the GET Token Transfer of V2 API endpoint, and it is used to get transfers of a token.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
token
|
str
|
The token address. |
required |
params
|
GetTokenTransferParam
|
The parameters to be used in the request. More details in the object definition. |
GetTokenTransferParam()
|
Returns:
| Type | Description |
|---|---|
GetTokenTransferResponse | Coroutine[None, None, GetTokenTransferResponse]
|
List of transfers of the token. |
Source code in src/cyhole/solscan/v2/interaction.py
447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |
_get_token_defi_activities
¶
_get_token_defi_activities(
sync: Literal[True],
token: str,
params: GetTokenDefiActivitiesParam = GetTokenDefiActivitiesParam(),
) -> GetTokenDefiActivitiesResponse
_get_token_defi_activities(
sync: Literal[False],
token: str,
params: GetTokenDefiActivitiesParam = GetTokenDefiActivitiesParam(),
) -> Coroutine[None, None, GetTokenDefiActivitiesResponse]
_get_token_defi_activities(
sync: bool,
token: str,
params: GetTokenDefiActivitiesParam = GetTokenDefiActivitiesParam(),
) -> (
GetTokenDefiActivitiesResponse
| Coroutine[None, None, GetTokenDefiActivitiesResponse]
)
This function refers to the GET Token DeFi Activities of V2 API endpoint, and it is used to get the DeFi activities of a token.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
token
|
str
|
The token address. |
required |
params
|
GetTokenDefiActivitiesParam
|
The parameters to be used in the request. More details in the object definition. |
GetTokenDefiActivitiesParam()
|
Returns:
| Type | Description |
|---|---|
GetTokenDefiActivitiesResponse | Coroutine[None, None, GetTokenDefiActivitiesResponse]
|
List of DeFi activities of the token. |
Source code in src/cyhole/solscan/v2/interaction.py
483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 | |
_get_token_markets
¶
_get_token_markets(
sync: Literal[True],
tokens: str | list[str],
program_address: str | list[str] | None = None,
page: int = 1,
page_size: int = SolscanPageSizeType.SIZE_10.value,
) -> GetTokenMarketsResponse
_get_token_markets(
sync: Literal[False],
tokens: str | list[str],
program_address: str | list[str] | None = None,
page: int = 1,
page_size: int = SolscanPageSizeType.SIZE_10.value,
) -> Coroutine[None, None, GetTokenMarketsResponse]
_get_token_markets(
sync: bool,
tokens: str | list[str],
program_address: str | list[str] | None = None,
page: int = 1,
page_size: int = SolscanPageSizeType.SIZE_10.value,
) -> (
GetTokenMarketsResponse
| Coroutine[None, None, GetTokenMarketsResponse]
)
This function refers to the GET Token Markets of V2 API endpoint, and it is used to get the markets data of a set of tokens.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tokens
|
str | list[str]
|
The token address or list of token addresses. |
required |
program_address
|
str | list[str] | None
|
The program address or list of program addresses. |
None
|
page
|
int
|
The page number. |
1
|
page_size
|
int
|
The number of markets per page.
The supported types are available on |
SolscanPageSizeType.SIZE_10.value
|
Returns:
| Type | Description |
|---|---|
GetTokenMarketsResponse | Coroutine[None, None, GetTokenMarketsResponse]
|
List of markets of the token. |
Source code in src/cyhole/solscan/v2/interaction.py
533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 | |
_get_token_list
¶
_get_token_list(
sync: Literal[True],
sort_by: str = SolscanSortType.MARKET_CAP.value,
order_by: str = SolscanOrderType.DESCENDING.value,
page: int = 1,
page_size: int = SolscanPageSizeType.SIZE_10.value,
) -> GetTokenListResponse
_get_token_list(
sync: Literal[False],
sort_by: str = SolscanSortType.MARKET_CAP.value,
order_by: str = SolscanOrderType.DESCENDING.value,
page: int = 1,
page_size: int = SolscanPageSizeType.SIZE_10.value,
) -> Coroutine[None, None, GetTokenListResponse]
_get_token_list(
sync: bool,
sort_by: str = SolscanSortType.MARKET_CAP.value,
order_by: str = SolscanOrderType.DESCENDING.value,
page: int = 1,
page_size: int = SolscanPageSizeType.SIZE_10.value,
) -> (
GetTokenListResponse
| Coroutine[None, None, GetTokenListResponse]
)
This function refers to the GET Token List of V2 API endpoint, and it is used to get the list of tokens.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sort_by
|
str
|
The sorting method.
The supported types are available on |
SolscanSortType.MARKET_CAP.value
|
order_by
|
str
|
The ordering to get the response.
The supported types are available on |
SolscanOrderType.DESCENDING.value
|
page
|
int
|
The page number. |
1
|
page_size
|
int
|
The number of tokens per page.
The supported types are available on |
SolscanPageSizeType.SIZE_10.value
|
Returns:
| Type | Description |
|---|---|
GetTokenListResponse | Coroutine[None, None, GetTokenListResponse]
|
List of tokens. |
Source code in src/cyhole/solscan/v2/interaction.py
596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 | |
_get_token_trending
¶
_get_token_trending(
sync: Literal[True], limit: int = 10
) -> GetTokenTrendingResponse
_get_token_trending(
sync: Literal[False], limit: int = 10
) -> Coroutine[None, None, GetTokenTrendingResponse]
_get_token_trending(
sync: bool, limit: int = 10
) -> (
GetTokenTrendingResponse
| Coroutine[None, None, GetTokenTrendingResponse]
)
This function refers to the GET Token Trending of V2 API endpoint, and it is used to get the trending tokens on Solscan.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
limit
|
int
|
The number of trending tokens to be returned. |
10
|
Returns:
| Type | Description |
|---|---|
GetTokenTrendingResponse | Coroutine[None, None, GetTokenTrendingResponse]
|
List of trending tokens. |
Source code in src/cyhole/solscan/v2/interaction.py
649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 | |
_get_token_price
¶
_get_token_price(
sync: Literal[True],
token: str,
time_range: (
datetime | tuple[datetime, datetime]
) = datetime.now(),
) -> GetTokenPriceResponse
_get_token_price(
sync: Literal[False],
token: str,
time_range: (
datetime | tuple[datetime, datetime]
) = datetime.now(),
) -> Coroutine[None, None, GetTokenPriceResponse]
_get_token_price(
sync: bool,
token: str,
time_range: (
datetime | tuple[datetime, datetime]
) = datetime.now(),
) -> (
GetTokenPriceResponse
| Coroutine[None, None, GetTokenPriceResponse]
)
This function refers to the GET Token Price of V2 API endpoint, and it is used to get the price of a token.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
token
|
str
|
The token address. |
required |
time_range
|
datetime | tuple[datetime, datetime]
|
The time range. It can be a single datetime object or a tuple of two datetime objects. |
datetime.now()
|
Returns:
| Type | Description |
|---|---|
GetTokenPriceResponse | Coroutine[None, None, GetTokenPriceResponse]
|
Price of the token. |
Source code in src/cyhole/solscan/v2/interaction.py
682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 | |
_get_token_holders
¶
_get_token_holders(
sync: Literal[True],
token: str,
amount_range: tuple[int, int] | None = None,
page: int = 1,
page_size: int = SolscanPageSizeType.SIZE_10.value,
) -> GetTokenHoldersResponse
_get_token_holders(
sync: Literal[False],
token: str,
amount_range: tuple[int, int] | None = None,
page: int = 1,
page_size: int = SolscanPageSizeType.SIZE_10.value,
) -> Coroutine[None, None, GetTokenHoldersResponse]
_get_token_holders(
sync: bool,
token: str,
amount_range: tuple[int, int] | None = None,
page: int = 1,
page_size: int = SolscanPageSizeType.SIZE_10.value,
) -> (
GetTokenHoldersResponse
| Coroutine[None, None, GetTokenHoldersResponse]
)
This function refers to the GET Token Holders of V2 API endpoint, and it is used to get the holders of a token.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
token
|
str
|
The token address. |
required |
amount_range
|
tuple[int, int] | None
|
The amount range. It can be a tuple of two integers (from, to). |
None
|
page
|
int
|
The page number. |
1
|
page_size
|
int
|
The number of holders per page.
The supported types are available on |
SolscanPageSizeType.SIZE_10.value
|
Returns:
| Type | Description |
|---|---|
GetTokenHoldersResponse | Coroutine[None, None, GetTokenHoldersResponse]
|
List of holders of the token. |
Source code in src/cyhole/solscan/v2/interaction.py
728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 | |
_get_token_meta
¶
_get_token_meta(
sync: Literal[True], token: str
) -> GetTokenMetaResponse
_get_token_meta(
sync: Literal[False], token: str
) -> Coroutine[None, None, GetTokenMetaResponse]
_get_token_meta(
sync: bool, token: str
) -> (
GetTokenMetaResponse
| Coroutine[None, None, GetTokenMetaResponse]
)
This function refers to the GET Token Meta of V2 API endpoint, and it is used to get the metadata of a token.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
token
|
str
|
The token address. |
required |
Returns:
| Type | Description |
|---|---|
GetTokenMetaResponse | Coroutine[None, None, GetTokenMetaResponse]
|
Metadata of the token. |
Source code in src/cyhole/solscan/v2/interaction.py
782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 | |
_get_nft_news
¶
_get_nft_news(
sync: Literal[True],
filter: str = "created_time",
page: int = 1,
page_size: int = SolscanNFTPageSizeType.SIZE_12.value,
) -> GetNFTNewsResponse
_get_nft_news(
sync: Literal[False],
filter: str = "created_time",
page: int = 1,
page_size: int = SolscanNFTPageSizeType.SIZE_12.value,
) -> Coroutine[None, None, GetNFTNewsResponse]
_get_nft_news(
sync: bool,
filter: str = "created_time",
page: int = 1,
page_size: int = SolscanNFTPageSizeType.SIZE_12.value,
) -> (
GetNFTNewsResponse
| Coroutine[None, None, GetNFTNewsResponse]
)
This function refers to the GET NFT News of V2 API endpoint, and it is used to get the latest NFT news.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filter
|
str
|
The filter to be used. |
'created_time'
|
page
|
int
|
The page number. |
1
|
page_size
|
int
|
The number of NFT per page.
The supported types are available on |
SolscanNFTPageSizeType.SIZE_12.value
|
Returns:
| Type | Description |
|---|---|
GetNFTNewsResponse | Coroutine[None, None, GetNFTNewsResponse]
|
List of NFT news. |
Source code in src/cyhole/solscan/v2/interaction.py
814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 | |
_get_nft_activities
¶
_get_nft_activities(
sync: Literal[True],
params: GetNFTActivitiesParam = GetNFTActivitiesParam(),
) -> GetNFTActivitiesResponse
_get_nft_activities(
sync: Literal[False],
params: GetNFTActivitiesParam = GetNFTActivitiesParam(),
) -> Coroutine[None, None, GetNFTActivitiesResponse]
_get_nft_activities(
sync: bool,
params: GetNFTActivitiesParam = GetNFTActivitiesParam(),
) -> (
GetNFTActivitiesResponse
| Coroutine[None, None, GetNFTActivitiesResponse]
)
This function refers to the GET NFT Activities of V2 API endpoint, and it is used to get the NFT activities.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
params
|
GetNFTActivitiesParam
|
The parameters to be used in the request. More details in the object definition. |
GetNFTActivitiesParam()
|
Returns:
| Type | Description |
|---|---|
GetNFTActivitiesResponse | Coroutine[None, None, GetNFTActivitiesResponse]
|
List of NFT activities. |
Source code in src/cyhole/solscan/v2/interaction.py
854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 | |
_get_nft_collection_lists
¶
_get_nft_collection_lists(
sync: Literal[True],
params: GetNFTCollectionListsParam = GetNFTCollectionListsParam(),
) -> GetNFTCollectionListsResponse
_get_nft_collection_lists(
sync: Literal[False],
params: GetNFTCollectionListsParam = GetNFTCollectionListsParam(),
) -> Coroutine[None, None, GetNFTCollectionListsResponse]
_get_nft_collection_lists(
sync: bool,
params: GetNFTCollectionListsParam = GetNFTCollectionListsParam(),
) -> (
GetNFTCollectionListsResponse
| Coroutine[None, None, GetNFTCollectionListsResponse]
)
This function refers to the GET NFT Collection Lists of V2 API endpoint, and it is used to get the list of NFT collections.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
params
|
GetNFTCollectionListsParam
|
The parameters to be used in the request. More details in the object definition. |
GetNFTCollectionListsParam()
|
Returns:
| Type | Description |
|---|---|
GetNFTCollectionListsResponse | Coroutine[None, None, GetNFTCollectionListsResponse]
|
List of NFT collections. |
Source code in src/cyhole/solscan/v2/interaction.py
888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 | |
_get_nft_collection_items
¶
_get_nft_collection_items(
sync: Literal[True],
collection: str,
sort_by: str = SolscanNFTItemSortType.LAST_TRADE.value,
page: int = 1,
page_size: int = SolscanNFTPageSizeType.SIZE_12.value,
) -> GetNFTCollectionItemsResponse
_get_nft_collection_items(
sync: Literal[False],
collection: str,
sort_by: str = SolscanNFTItemSortType.LAST_TRADE.value,
page: int = 1,
page_size: int = SolscanNFTPageSizeType.SIZE_12.value,
) -> Coroutine[None, None, GetNFTCollectionItemsResponse]
_get_nft_collection_items(
sync: bool,
collection: str,
sort_by: str = SolscanNFTItemSortType.LAST_TRADE.value,
page: int = 1,
page_size: int = SolscanNFTPageSizeType.SIZE_12.value,
) -> (
GetNFTCollectionItemsResponse
| Coroutine[None, None, GetNFTCollectionItemsResponse]
)
This function refers to the GET NFT Collection Items of V2 API endpoint, and it is used to get the items of a NFT collection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
collection
|
str
|
The collection address. |
required |
sort_by
|
str
|
The sorting method.
The supported types are available on |
SolscanNFTItemSortType.LAST_TRADE.value
|
page
|
int
|
The page number. |
1
|
page_size
|
int
|
The number of items per page.
The supported types are available on |
SolscanNFTPageSizeType.SIZE_12.value
|
Returns:
| Type | Description |
|---|---|
GetNFTCollectionItemsResponse | Coroutine[None, None, GetNFTCollectionItemsResponse]
|
List of NFT items of the collection. |
Source code in src/cyhole/solscan/v2/interaction.py
936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 | |
_get_transaction_last
¶
_get_transaction_last(
sync: Literal[True],
limit: int = SolscanReturnLimitType.LIMIT_10.value,
filter: str = SolscanTransactionFilterType.EXCEPT_VOTE.value,
) -> GetTransactionLastResponse
_get_transaction_last(
sync: Literal[False],
limit: int = SolscanReturnLimitType.LIMIT_10.value,
filter: str = SolscanTransactionFilterType.EXCEPT_VOTE.value,
) -> Coroutine[None, None, GetTransactionLastResponse]
_get_transaction_last(
sync: bool,
limit: int = SolscanReturnLimitType.LIMIT_10.value,
filter: str = SolscanTransactionFilterType.EXCEPT_VOTE.value,
) -> (
GetTransactionLastResponse
| Coroutine[None, None, GetTransactionLastResponse]
)
This function refers to the GET Transaction Last of V2 API endpoint, and it is used to get the latest transactions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
limit
|
int
|
The number of transactions to be returned.
The supported types are available on |
SolscanReturnLimitType.LIMIT_10.value
|
filter
|
str
|
The filter to be used.
The supported types are available on |
SolscanTransactionFilterType.EXCEPT_VOTE.value
|
Returns:
| Type | Description |
|---|---|
GetTransactionLastResponse | Coroutine[None, None, GetTransactionLastResponse]
|
List of latest transactions. |
Source code in src/cyhole/solscan/v2/interaction.py
987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 | |
_get_transaction_actions
¶
_get_transaction_actions(
sync: Literal[True], transaction: str
) -> GetTransactionActionsResponse
_get_transaction_actions(
sync: Literal[False], transaction: str
) -> Coroutine[None, None, GetTransactionActionsResponse]
_get_transaction_actions(
sync: bool, transaction: str
) -> (
GetTransactionActionsResponse
| Coroutine[None, None, GetTransactionActionsResponse]
)
This function refers to the GET Transaction Actions of V2 API endpoint, and it is used to get the actions of a transaction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
transaction
|
str
|
The transaction signature. |
required |
Returns:
| Type | Description |
|---|---|
GetTransactionActionsResponse | Coroutine[None, None, GetTransactionActionsResponse]
|
List of actions of the transaction. |
Source code in src/cyhole/solscan/v2/interaction.py
1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 | |
_get_block_last
¶
_get_block_last(
sync: Literal[True],
page_size: int = SolscanPageSizeType.SIZE_10.value,
) -> GetBlockLastResponse
_get_block_last(
sync: Literal[False],
page_size: int = SolscanPageSizeType.SIZE_10.value,
) -> Coroutine[None, None, GetBlockLastResponse]
_get_block_last(
sync: bool,
page_size: int = SolscanPageSizeType.SIZE_10.value,
) -> (
GetBlockLastResponse
| Coroutine[None, None, GetBlockLastResponse]
)
This function refers to the GET Block Last of V2 API endpoint, and it is used to get the latest blocks.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
page_size
|
int
|
The number of blocks to be returned.
The supported types are available on |
SolscanPageSizeType.SIZE_10.value
|
Returns:
| Type | Description |
|---|---|
GetBlockLastResponse | Coroutine[None, None, GetBlockLastResponse]
|
List of latest blocks. |
Source code in src/cyhole/solscan/v2/interaction.py
1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 | |
_get_block_transactions
¶
_get_block_transactions(
sync: Literal[True],
block: int,
page: int = 1,
page_size: int = SolscanPageSizeType.SIZE_10.value,
) -> GetBlockTransactionsResponse
_get_block_transactions(
sync: Literal[False],
block: int,
page: int = 1,
page_size: int = SolscanPageSizeType.SIZE_10.value,
) -> Coroutine[None, None, GetBlockTransactionsResponse]
_get_block_transactions(
sync: bool,
block: int,
page: int = 1,
page_size: int = SolscanPageSizeType.SIZE_10.value,
) -> (
GetBlockTransactionsResponse
| Coroutine[None, None, GetBlockTransactionsResponse]
)
This function refers to the GET Block Transactions of V2 API endpoint, and it is used to get the transactions of a block.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
block
|
int
|
The block number. |
required |
page
|
int
|
The page number. |
1
|
page_size
|
int
|
The number of transactions per page.
The supported types are available on |
SolscanPageSizeType.SIZE_10.value
|
Returns:
| Type | Description |
|---|---|
GetBlockTransactionsResponse | Coroutine[None, None, GetBlockTransactionsResponse]
|
List of transactions of the block. |
Source code in src/cyhole/solscan/v2/interaction.py
1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 | |
_get_block_detail
¶
_get_block_detail(
sync: Literal[True], block: int
) -> GetBlockDetailResponse
_get_block_detail(
sync: Literal[False], block: int
) -> Coroutine[None, None, GetBlockDetailResponse]
_get_block_detail(
sync: bool, block: int
) -> (
GetBlockDetailResponse
| Coroutine[None, None, GetBlockDetailResponse]
)
This function refers to the GET Block Detail of V2 API endpoint, and it is used to get the detail of a block.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
block
|
int
|
The block number. |
required |
Returns:
| Type | Description |
|---|---|
GetBlockDetailResponse | Coroutine[None, None, GetBlockDetailResponse]
|
Detail of the block. |
Source code in src/cyhole/solscan/v2/interaction.py
1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 | |
_raise
¶
_raise(exception: HTTPError) -> SolscanException
Internal function used to raise the manage the exceptions raised by the API.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
exception
|
HTTPError
|
the HTTP error returned from Solscan API. |
required |
Raises:
| Type | Description |
|---|---|
SolscanException
|
general exception raised when an unknown error is found. |
Source code in src/cyhole/solscan/v2/interaction.py
1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 | |