-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/das-39-add-gettokenaccounts-supp…
…ort-to-das-api-main' into das-54-show-zero-balance-filter-rebase
- Loading branch information
Showing
13 changed files
with
326 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
use sea_orm::{DatabaseConnection, DbErr}; | ||
|
||
use crate::{ | ||
dao::PageOptions, | ||
rpc::{options::Options, response::TokenAccountList}, | ||
}; | ||
|
||
use super::common::{build_token_list_response, create_pagination}; | ||
|
||
pub async fn get_token_accounts( | ||
db: &DatabaseConnection, | ||
owner_address: Option<Vec<u8>>, | ||
mint_address: Option<Vec<u8>>, | ||
page_options: &PageOptions, | ||
options: &Options, | ||
) -> Result<TokenAccountList, DbErr> { | ||
let pagination = create_pagination(page_options)?; | ||
|
||
let token_accounts = crate::dao::scopes::asset::get_token_accounts( | ||
db, | ||
owner_address, | ||
mint_address, | ||
&pagination, | ||
page_options.limit, | ||
) | ||
.await?; | ||
|
||
Ok(build_token_list_response( | ||
token_accounts, | ||
page_options.limit, | ||
&pagination, | ||
options, | ||
)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+312 Bytes
..._tests/tests/data/accounts/get_token_accounts/jKLTJu7nE1zLmC2J2xjVVBm4G7vJcKGCGQX36Jrsba2
Binary file not shown.
Oops, something went wrong.